From c0ca897eb4f8eecfd1a5a642c11863954d7175a2 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Tue, 30 Apr 2024 14:36:38 +0200 Subject: [PATCH] fix: fixed references to the original file format in the help and readme file (#219) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- Makefile | 2 +- README.md | 14 +++++++------- src/cli.rs | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f8f9265..096c7e69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -600,7 +600,7 @@ checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] name = "encstr" -version = "0.28.1-alpha.2" +version = "0.28.1-alpha.3" [[package]] name = "enum-map" @@ -757,7 +757,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hl" -version = "0.28.1-alpha.2" +version = "0.28.1-alpha.3" dependencies = [ "atoi", "bincode", diff --git a/Cargo.toml b/Cargo.toml index bc9bbaa1..7f587871 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [".", "crate/encstr"] [workspace.package] repository = "https://github.com/pamburus/hl" authors = ["Pavel Ivanov "] -version = "0.28.1-alpha.2" +version = "0.28.1-alpha.3" edition = "2021" license = "MIT" diff --git a/Makefile b/Makefile index 8ebca76f..85f3cda1 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ bench: ## Show usage of the binary usage: build - @env -i ./target/debug/hl --help + @env -i HL_CONFIG= ./target/debug/hl --help .PHONY: usage ## Clean build artifacts diff --git a/README.md b/README.md index 9282f1bb..de6f8b0d 100644 --- a/README.md +++ b/README.md @@ -241,9 +241,9 @@ See other [screenshots](https://github.com/pamburus/hl-extra/tree/90be58af2fb91d - Notes - * Special field names that are reserved for filtering by predefined fields regardless of the actual JSON field names used to load the corresponding value: `level`, `message`, `caller` and `logger`. - * To address a JSON field with one of these names instead of predefined fields, add a period before its name, i.e., `.level` will perform a match against the "level" JSON field. - * To address a JSON field by its exact name, use a JSON-formatted string, i.e. `-q '".level" = info'`. + * Special field names that are reserved for filtering by predefined fields regardless of the actual source field names used to load the corresponding value: `level`, `message`, `caller` and `logger`. + * To address a source field with one of these names instead of predefined fields, add a period before its name, i.e., `.level` will perform a match against the "level" source field. + * To address a source field by its exact name, use a JSON-formatted string, i.e. `-q '".level" = info'`. * To specify special characters in field values, also use a JSON-formatted string, i.e. ``` $ hl my-service.log -q 'message contain "Error:\nSomething unexpected happened"' @@ -450,7 +450,7 @@ See other [screenshots](https://github.com/pamburus/hl-extra/tree/90be58af2fb91d ### Complete set of options and flags ``` -JSON log converter to human readable representation +JSON and logfmt log converter to human readable representation Usage: hl [OPTIONS] [FILE]... @@ -463,8 +463,8 @@ Options: --paging Output paging options [env: HL_PAGING=] [default: auto] [possible values: auto, always, never] -P Handful alias for --paging=never, overrides --paging option --theme Color theme [env: HL_THEME=] [default: universal] - -r, --raw Output raw JSON messages instead of formatter messages, it can be useful for applying filters and saving results in original format - --no-raw Disable raw JSON messages output, overrides --raw option + -r, --raw Output raw source messages instead of formatter messages, it can be useful for applying filters and saving results in original format + --no-raw Disable raw source messages output, overrides --raw option --raw-fields Disable unescaping and prettifying of field values --allow-prefix Allow non-JSON prefixes before JSON messages [env: HL_ALLOW_PREFIX=] --interrupt-ignore-count Number of interrupts to ignore, i.e. Ctrl-C (SIGINT) [env: HL_INTERRUPT_IGNORE_COUNT=] [default: 3] @@ -477,7 +477,7 @@ Options: -l, --level Filtering by level [env: HL_LEVEL=] --since Filtering by timestamp >= the value (--time-zone and --local options are honored) --until Filtering by timestamp <= the value (--time-zone and --local options are honored) - -t, --time-format Time format, see https://man7.org/linux/man-pages/man1/date.1.html [env: HL_TIME_FORMAT=] [default: "%Y-%m-%d %T.%3N"] + -t, --time-format Time format, see https://man7.org/linux/man-pages/man1/date.1.html [env: HL_TIME_FORMAT=] [default: "%b %d %T.%3N"] -Z, --time-zone Time zone name, see column "TZ identifier" at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones [env: HL_TIME_ZONE=] [default: UTC] -L, --local Use local time zone, overrides --time-zone option --no-local Disable local time zone, overrides --local option diff --git a/src/cli.rs b/src/cli.rs index 36fff930..2ff392a7 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -15,7 +15,7 @@ use crate::{ // --- -/// JSON log converter to human readable representation. +/// JSON and logfmt log converter to human readable representation. #[derive(Parser)] #[clap(version, disable_help_flag = true)] pub struct Opt { @@ -46,11 +46,11 @@ pub struct Opt { )] pub theme: String, - /// Output raw JSON messages instead of formatter messages, it can be useful for applying filters and saving results in original format. + /// Output raw source messages instead of formatter messages, it can be useful for applying filters and saving results in original format. #[arg(short, long, overrides_with = "raw")] pub raw: bool, - /// Disable raw JSON messages output, overrides --raw option. + /// Disable raw source messages output, overrides --raw option. #[arg(long, overrides_with = "raw")] _no_raw: bool,