version 8.0.2: add severity level for log sentry events (#152)

* script to update version

* version 8.0.2: add severity level for log sentry events
This commit is contained in:
johnfoconnor 2020-01-28 14:04:18 -08:00 committed by Benjamin Sergeant
parent 2d28b7d4ff
commit d91b24723d
5 changed files with 64 additions and 1 deletions

View File

@ -1,6 +1,10 @@
# Changelog
All changes to this project will be documented in this file.
## [8.0.2] - 2020-01-28
Extract severity level when emitting messages to sentry
## [8.0.1] - 2020-01-28
Fix bug #151 - If a socket connection is interrupted, calling stop() on the IXWebSocket object blocks until the next retry

View File

@ -166,6 +166,17 @@ namespace ix
tags.append(tag);
}
}
if (msg["data"]["info"].isMember("level_str"))
{
// https://docs.sentry.io/enriching-error-data/context/?platform=python#setting-the-level
std::string level = msg["data"]["info"]["level_str"].asString();
if (level == "critical")
{
level = "fatal";
}
payload["level"] = level;
}
}
else
{

View File

@ -6,4 +6,4 @@
#pragma once
#define IX_WEBSOCKET_VERSION "8.0.1"
#define IX_WEBSOCKET_VERSION "8.0.2"

View File

@ -49,6 +49,9 @@ BUILD := ${NAME}:build
print_version:
@echo 'IXWebSocket version =>' ${TAG}
set_version:
sh tools/update_version.sh ${VERSION}
docker_test:
docker build -f docker/Dockerfile.debian -t bsergean/ixwebsocket_test:build .

45
tools/update_version.sh Executable file
View File

@ -0,0 +1,45 @@
#/bin/sh
ver_gt() {
[ "$1" != "$2" ] && [ "$2" == "$(echo "$1\n$2" | sort -V | head -n1)" ]
}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_ROOT="$(dirname ${SCRIPT_DIR})"
CUR_VSN=$(bash $SCRIPT_DIR/extract_version.sh)
NEW_VSN="$1"
check_ver() {
if [[ $NEW_VSN =~ ^[0-9.]+$ ]]; then
:
else
echo "Invalid version '$NEW_VSN'"
exit 1
fi
}
check_ver_increase() {
if ! ver_gt $NEW_VSN $CUR_VSN; then
echo "Invalid version '$NEW_VSN'. Must be greater than current version $CUR_VSN"
exit 1
fi
}
check_changelog() {
if ! egrep "\b$NEW_VSN\b" $PROJECT_ROOT/docs/CHANGELOG.md >/dev/null; then
echo "Invalid version '$NEW_VSN'. Missing entry in CHANGELOG.md"
exit 1
fi
}
set_version() {
sed -i '' "s/$CUR_VSN/$NEW_VSN/g" $PROJECT_ROOT/ixwebsocket/IXWebSocketVersion.h
echo "Set version to '$NEW_VSN'"
exit 0
}
check_ver
check_ver_increase
check_changelog
set_version