Skip to content

Commit 8c9362a

Browse files
committed
new feature: --log-level can now be used twice, --debug can now be used twice
improved log-level specification, separating nostr-commander-rs from lower-level modules
1 parent 8743faf commit 8c9362a

File tree

8 files changed

+199
-65
lines changed

8 files changed

+199
-65
lines changed

Cargo.lock

Lines changed: 41 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "nostr-commander"
5-
version = "0.3.0"
5+
version = "0.3.1"
66
edition = "2021"
77
description = "simple but convenient CLI-based Nostr client app for publishing,sending and subscribing"
88
documentation = "https://docs.rs/nostr-commander"
@@ -31,8 +31,8 @@ thiserror = "1.0"
3131
serde = { version = "1.0", features = ["derive"] }
3232
url = { version = "2.4", features = ["serde"] }
3333
serde_json = "1.0"
34-
tracing-subscriber = "0.3"
3534
tracing = "0.1"
35+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
3636
directories = "5.0"
3737
update-informer = "1.1"
3838
chrono = "0.4"

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,27 @@ Options:
209209
default log level set with environment variable 'RUST_LOG' will be
210210
used. If used, log level will be set to 'DEBUG' and debugging
211211
information will be printed. '-d' is a shortcut for '--log-level
212-
DEBUG'. See also '--log-level'. '-d' takes precedence over
213-
'--log-level'. Additionally, have a look also at the option
214-
'--verbose'
215-
216-
--log-level <LOG_LEVEL>
212+
DEBUG'. If used once as in '-d' it will set and/or overwrite
213+
--log-level to '--log-level debug'. If used twice as in '-d -d' it
214+
will set and/or overwrite --log-level to '--log-level debug debug'.
215+
And third or futher occurance of '-d' will be ignored. See also
216+
'--log-level'. '-d' takes precedence over '--log-level'.
217+
Additionally, have a look also at the option '--verbose'
218+
219+
--log-level <LOG_LEVEL>...
217220
Set the log level by overwriting the default log level. Details:: If
218221
not used, then the default log level set with environment variable
219-
'RUST_LOG' will be used. See also '--debug' and '--verbose'
220-
221-
[default: none]
222+
'RUST_LOG' will be used. If used with one value specified this value
223+
is assigned to the log level of matrix-commander-rs. If used with two
224+
values specified the first value is assigned to the log level of
225+
matrix-commander-rs. The second value is asigned to the lower level
226+
modules. More than two values should not be specified. --debug
227+
overwrites -log-level. See also '--debug' and '--verbose'.
228+
Alternatively you can use the RUST_LOG environment variable. An
229+
example use of RUST_LOG is to use neither --log-level nor --debug,
230+
and to set RUST_LOG="error,matrix_commander_rs=debug" which turns off
231+
debugging on all lower level modules and turns debugging on only for
232+
matrix-commander-rs
222233
223234
Possible values:
224235
- none: None: not set, default

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.0
1+
0.3.1

help.help.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Options:
2121
Prints README.md file, the documenation in Markdown.
2222
-d, --debug...
2323
Overwrite the default log level.
24-
--log-level <LOG_LEVEL>
24+
--log-level <LOG_LEVEL>...
2525
Set the log level by overwriting the default log level.
2626
--verbose...
2727
Set the verbosity level.

help.manual.txt

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,27 @@ Options:
4848
default log level set with environment variable 'RUST_LOG' will be
4949
used. If used, log level will be set to 'DEBUG' and debugging
5050
information will be printed. '-d' is a shortcut for '--log-level
51-
DEBUG'. See also '--log-level'. '-d' takes precedence over
52-
'--log-level'. Additionally, have a look also at the option
53-
'--verbose'
54-
55-
--log-level <LOG_LEVEL>
51+
DEBUG'. If used once as in '-d' it will set and/or overwrite
52+
--log-level to '--log-level debug'. If used twice as in '-d -d' it
53+
will set and/or overwrite --log-level to '--log-level debug debug'.
54+
And third or futher occurance of '-d' will be ignored. See also
55+
'--log-level'. '-d' takes precedence over '--log-level'.
56+
Additionally, have a look also at the option '--verbose'
57+
58+
--log-level <LOG_LEVEL>...
5659
Set the log level by overwriting the default log level. Details:: If
5760
not used, then the default log level set with environment variable
58-
'RUST_LOG' will be used. See also '--debug' and '--verbose'
59-
60-
[default: none]
61+
'RUST_LOG' will be used. If used with one value specified this value
62+
is assigned to the log level of matrix-commander-rs. If used with two
63+
values specified the first value is assigned to the log level of
64+
matrix-commander-rs. The second value is asigned to the lower level
65+
modules. More than two values should not be specified. --debug
66+
overwrites -log-level. See also '--debug' and '--verbose'.
67+
Alternatively you can use the RUST_LOG environment variable. An
68+
example use of RUST_LOG is to use neither --log-level nor --debug,
69+
and to set RUST_LOG="error,matrix_commander_rs=debug" which turns off
70+
debugging on all lower level modules and turns debugging on only for
71+
matrix-commander-rs
6172

6273
Possible values:
6374
- none: None: not set, default

help.usage.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Options:
77
--manual
88
--readme
99
-d, --debug...
10-
--log-level <LOG_LEVEL>
10+
--log-level <LOG_LEVEL>...
1111
--verbose...
1212
-c, --credentials <PATH_TO_FILE>
1313
--create-user

0 commit comments

Comments
 (0)