Skip to content

Commit

Permalink
new feature: --log-level can now be used twice, --debug can now be us…
Browse files Browse the repository at this point in the history
…ed twice

improved log-level specification, separating nostr-commander-rs from lower-level modules
  • Loading branch information
8go committed Oct 1, 2024
1 parent 8743faf commit 8c9362a
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 65 deletions.
55 changes: 41 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "nostr-commander"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
description = "simple but convenient CLI-based Nostr client app for publishing,sending and subscribing"
documentation = "https://docs.rs/nostr-commander"
Expand Down Expand Up @@ -31,8 +31,8 @@ thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
url = { version = "2.4", features = ["serde"] }
serde_json = "1.0"
tracing-subscriber = "0.3"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
directories = "5.0"
update-informer = "1.1"
chrono = "0.4"
Expand Down
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,27 @@ Options:
default log level set with environment variable 'RUST_LOG' will be
used. If used, log level will be set to 'DEBUG' and debugging
information will be printed. '-d' is a shortcut for '--log-level
DEBUG'. See also '--log-level'. '-d' takes precedence over
'--log-level'. Additionally, have a look also at the option
'--verbose'
--log-level <LOG_LEVEL>
DEBUG'. If used once as in '-d' it will set and/or overwrite
--log-level to '--log-level debug'. If used twice as in '-d -d' it
will set and/or overwrite --log-level to '--log-level debug debug'.
And third or futher occurance of '-d' will be ignored. See also
'--log-level'. '-d' takes precedence over '--log-level'.
Additionally, have a look also at the option '--verbose'
--log-level <LOG_LEVEL>...
Set the log level by overwriting the default log level. Details:: If
not used, then the default log level set with environment variable
'RUST_LOG' will be used. See also '--debug' and '--verbose'
[default: none]
'RUST_LOG' will be used. If used with one value specified this value
is assigned to the log level of matrix-commander-rs. If used with two
values specified the first value is assigned to the log level of
matrix-commander-rs. The second value is asigned to the lower level
modules. More than two values should not be specified. --debug
overwrites -log-level. See also '--debug' and '--verbose'.
Alternatively you can use the RUST_LOG environment variable. An
example use of RUST_LOG is to use neither --log-level nor --debug,
and to set RUST_LOG="error,matrix_commander_rs=debug" which turns off
debugging on all lower level modules and turns debugging on only for
matrix-commander-rs
Possible values:
- none: None: not set, default
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.3.1
2 changes: 1 addition & 1 deletion help.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Options:
Prints README.md file, the documenation in Markdown.
-d, --debug...
Overwrite the default log level.
--log-level <LOG_LEVEL>
--log-level <LOG_LEVEL>...
Set the log level by overwriting the default log level.
--verbose...
Set the verbosity level.
Expand Down
27 changes: 19 additions & 8 deletions help.manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,27 @@ Options:
default log level set with environment variable 'RUST_LOG' will be
used. If used, log level will be set to 'DEBUG' and debugging
information will be printed. '-d' is a shortcut for '--log-level
DEBUG'. See also '--log-level'. '-d' takes precedence over
'--log-level'. Additionally, have a look also at the option
'--verbose'

--log-level <LOG_LEVEL>
DEBUG'. If used once as in '-d' it will set and/or overwrite
--log-level to '--log-level debug'. If used twice as in '-d -d' it
will set and/or overwrite --log-level to '--log-level debug debug'.
And third or futher occurance of '-d' will be ignored. See also
'--log-level'. '-d' takes precedence over '--log-level'.
Additionally, have a look also at the option '--verbose'

--log-level <LOG_LEVEL>...
Set the log level by overwriting the default log level. Details:: If
not used, then the default log level set with environment variable
'RUST_LOG' will be used. See also '--debug' and '--verbose'

[default: none]
'RUST_LOG' will be used. If used with one value specified this value
is assigned to the log level of matrix-commander-rs. If used with two
values specified the first value is assigned to the log level of
matrix-commander-rs. The second value is asigned to the lower level
modules. More than two values should not be specified. --debug
overwrites -log-level. See also '--debug' and '--verbose'.
Alternatively you can use the RUST_LOG environment variable. An
example use of RUST_LOG is to use neither --log-level nor --debug,
and to set RUST_LOG="error,matrix_commander_rs=debug" which turns off
debugging on all lower level modules and turns debugging on only for
matrix-commander-rs

Possible values:
- none: None: not set, default
Expand Down
2 changes: 1 addition & 1 deletion help.usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Options:
--manual
--readme
-d, --debug...
--log-level <LOG_LEVEL>
--log-level <LOG_LEVEL>...
--verbose...
-c, --credentials <PATH_TO_FILE>
--create-user
Expand Down
Loading

0 comments on commit 8c9362a

Please sign in to comment.