From 1e874e790c12839695761a654b44fb427149a353 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Wed, 28 Jul 2021 01:43:55 +0200 Subject: init --- playground/build.sh | 6 ++++++ playground/client-status-linux.sh | 7 +++++++ playground/env.sh | 8 ++++++++ playground/restlog.sh | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100755 playground/build.sh create mode 100755 playground/client-status-linux.sh create mode 100644 playground/env.sh create mode 100755 playground/restlog.sh (limited to 'playground') diff --git a/playground/build.sh b/playground/build.sh new file mode 100755 index 0000000..afd3f13 --- /dev/null +++ b/playground/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +cd $ROOT_PATH +exec $PYTHON -m doit build diff --git a/playground/client-status-linux.sh b/playground/client-status-linux.sh new file mode 100755 index 0000000..fa8dc90 --- /dev/null +++ b/playground/client-status-linux.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +exec $PYTHON -m restlog.clients.status.linux \ + --source client1 \ + http://127.0.0.1:23233 diff --git a/playground/env.sh b/playground/env.sh new file mode 100644 index 0000000..076803f --- /dev/null +++ b/playground/env.sh @@ -0,0 +1,8 @@ +PYTHON=${PYTHON:-python3} +PLAYGROUND_PATH=$(cd $(dirname -- "$0") && pwd) +ROOT_PATH=$PLAYGROUND_PATH/.. +DATA_PATH=$PLAYGROUND_PATH/data + +export PYTHONPATH=$ROOT_PATH/src_py + +mkdir -p $DATA_PATH diff --git a/playground/restlog.sh b/playground/restlog.sh new file mode 100755 index 0000000..debbd81 --- /dev/null +++ b/playground/restlog.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +LOG_LEVEL=DEBUG +CONF_PATH=$DATA_PATH/restlog.yaml +DB_PATH=$DATA_PATH/restlog.db + +cat > $CONF_PATH << EOF +log: + version: 1 + formatters: + console_formatter: + format: "[%(asctime)s %(levelname)s %(name)s] %(message)s" + handlers: + console_handler: + class: logging.StreamHandler + formatter: console_formatter + level: DEBUG + loggers: + hat.monitor: + level: $LOG_LEVEL + root: + level: INFO + handlers: ['console_handler'] + disable_existing_loggers: false +host: '127.0.0.1' +port: 23233 +db_path: $DB_PATH +max_results: 100 +EOF + +exec $PYTHON -m restlog --conf $CONF_PATH "$@" -- cgit v1.2.3-70-g09d2