Skip to content

Commit

Permalink
Fix loglevel options (#323)
Browse files Browse the repository at this point in the history
* Fix new log levels

* Update readme
  • Loading branch information
luiscantero authored Nov 28, 2023
1 parent 170c862 commit 4af23f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ Options:
the timespan in seconds when the logfile should be
flushed.
Default: 00:00:30 sec
--ll, --loglevel=VALUE the loglevel to use (allowed: fatal, error, warn,
info, debug, verbose).
--ll, --loglevel=VALUE the loglevel to use (allowed: critical, error,
warn, info, debug, trace).
Default: info
--sc, --simulationcyclecount=VALUE
count of cycles in one simulation phase
Expand Down Expand Up @@ -337,14 +337,15 @@ Options:
--to, --trustowncert the own certificate is put into the trusted
certificate store automatically.
Default: False
--msec, --maxsessioncount
--msec, --maxsessioncount=VALUE
maximum number of parallel sessions.
Default: 100
--msuc, --maxsubscriptioncount
--msuc, --maxsubscriptioncount=VALUE
maximum number of subscriptions.
Default: 100
--mqrc, --maxqueuedrequestcount
maximum number of requests that will be queued waiting for a thread.
--mqrc, --maxqueuedrequestcount=VALUE
maximum number of requests that will be queued
waiting for a thread.
Default: 2000
--at, --appcertstoretype=VALUE
the own application cert store type.
Expand Down
4 changes: 2 additions & 2 deletions src/CliOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public static Mono.Options.OptionSet InitCommandLineOptions()
}
}
},
{ "ll|loglevel=", "the loglevel to use (allowed: critical, warn, info, debug, trace).\nDefault: info", (string s) => {
{ "ll|loglevel=", "the loglevel to use (allowed: critical, error, warn, info, debug, trace).\nDefault: info", (string s) => {
var logLevels = new List<string> {"critical", "error", "warn", "info", "debug", "trace"};
if (logLevels.Contains(s.ToLowerInvariant()))
{
Program.LogLevelCli = s.ToLowerInvariant();
}
else
{
throw new OptionException("The loglevel must be one of: fatal, error, warn, info, debug, verbose", "loglevel");
throw new OptionException($"The loglevel must be one of: {string.Join(", ", logLevels)}", "loglevel");
}
}
},
Expand Down

0 comments on commit 4af23f7

Please sign in to comment.