diff --git a/StaticGalleryBuilder.code-workspace b/StaticGalleryBuilder.code-workspace index f2e98b3..29ec569 100644 --- a/StaticGalleryBuilder.code-workspace +++ b/StaticGalleryBuilder.code-workspace @@ -147,6 +147,9 @@ "python.analysis.inlayHints.callArgumentNames": "off", "python.analysis.inlayHints.functionReturnTypes": false, "python.analysis.inlayHints.variableTypes": false, + "yaml.schemas": { + "https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.schema.json": "file:///home/user/git/github.com/greflm13/StaticGalleryBuilder/hl_config.yaml" + }, }, "tasks": { "version": "2.0.0", @@ -218,6 +221,21 @@ "clear": true }, "group": "build" + }, + { + "command": "LESS=-SR hl logs/latest.jsonl --config hl_config.yaml", + "isBackground": false, + "label": "View Latest Log", + "problemMatcher": [], + "type": "shell", + "presentation": { + "echo": false, + "reveal": "always", + "focus": true, + "panel": "dedicated", + "showReuseMessage": false, + "clear": true + } } ], }, diff --git a/hl_config.yaml b/hl_config.yaml new file mode 100644 index 0000000..bc0985e --- /dev/null +++ b/hl_config.yaml @@ -0,0 +1,73 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.schema.json +$schema: https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.schema.json + +# Time format, see https://man7.org/linux/man-pages/man1/date.1.html for details. +time-format: "%b %d %T.%3N" + +# Time zone name, see column "TZ identifier" at +# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones page. +time-zone: "Europe/Vienna" + +# Settings for fields processing. +fields: + # Configuration of the predefined set of fields. + predefined: + time: + show: auto + names: ["asctime"] + logger: + names: ["defaultlogger", "consolelogger"] + level: + show: auto + variants: + - names: ["levelname"] + values: + debug: ["DEBUG"] + info: ["INFO"] + warning: ["WARNING", "WARN"] + error: ["ERROR", "FATAL", "CRITICAL"] + - names: ["levelno"] + values: + debug: [10] + info: [20] + warning: [30] + error: [40, 50] + message: + names: ["message"] + caller: + names: ["funcName"] + caller-file: + names: ["filename"] + caller-line: + names: ["lineno"] + # List of wildcard field names to ignore. + ignore: ["_*"] + # List of exact field names to hide. + hide: ["pathname", "created", "levelno", "taskname", "relativeCreated", "thread", "process", "msecs"] + +# Formatting settings. +formatting: + flatten: always + punctuation: + logger-name-separator: ":" + field-key-value-separator: "=" + string-opening-quote: "'" + string-closing-quote: "'" + source-location-separator: "→ " + hidden-fields-indicator: " ..." + level-left-separator: "│" + level-right-separator: "│" + input-number-prefix: "#" + input-number-left-separator: "" + input-number-right-separator: " │ " + input-name-left-separator: "" + input-name-right-separator: " │ " + input-name-clipping: "··" + input-name-common-part: "··" + array-separator: " " + +# Number of processing threads, configured automatically based on CPU count if not specified. +concurrency: ~ + +# Currently selected theme. +theme: "neutral" diff --git a/view-latest-log.sh b/view-latest-log.sh new file mode 100755 index 0000000..881fc00 --- /dev/null +++ b/view-latest-log.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +LESS=-SR hl logs/latest.jsonl --config hl_config.yaml + diff --git a/view-logs.sh b/view-logs.sh new file mode 100755 index 0000000..6fd9089 --- /dev/null +++ b/view-logs.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +LESS=-SR hl $(ls -tr logs/*.{jsonl,jsonl.gz}) --config hl_config.yaml