Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tracing functionality to show internal processing details #158

Closed
remkop opened this issue Aug 4, 2017 · 3 comments
Closed

Support tracing functionality to show internal processing details #158

remkop opened this issue Aug 4, 2017 · 3 comments

Comments

@remkop
Copy link
Owner

remkop commented Aug 4, 2017

#129 (handling situations where the same option is specified multiple times) was implemented except for these:

  • accept and emit warning while using last value
  • Also "warn" if parameters values diverge

It would be good to have a generic mechanism for showing warnings.
An internal logging facility could have warn, info, debug log levels.
Remaining decisions:

  • What should be the default log level? It may make sense to offer an API to control this programmatically.
  • At run time, it should be end users, not the application author, that control the log level. How should end users control the log level to aid with trouble shooting? System properties?
@remkop remkop added this to the 1.0.0 milestone Aug 6, 2017
@remkop remkop changed the title Logging (warn, info, debug) - warn enabled by default Add internal logging Aug 10, 2017
@remkop remkop changed the title Add internal logging Support tracing internal processing details Aug 15, 2017
@remkop
Copy link
Owner Author

remkop commented Aug 15, 2017

Provide system property picocli.trace to control tracing at runtime:

  • convenience shortcut: if this system property exists without any value: trace = INFO
  • if system property is not specified default is trace = WARN
  • valid values: { OFF, WARN, INFO, DEBUG }

TBD: provide system property to let users control target stream?

  • For example: picocli.traceStream : { stderr, stdout, file:... }, default = stderr

On request also provide a programmatic API for the above.

@remkop remkop changed the title Support tracing internal processing details Support tracing functionality to show internal processing details Aug 15, 2017
@remkop
Copy link
Owner Author

remkop commented Aug 19, 2017

Usage:

  • WARN - when an existing value is replaced with another value. TBD: warn when a single value option was specified multiple times? (with same value). Note: no warning required when the default value is overwritten!
  • INFO - when a command line argument was processed completely and a value has been assigned to a field
  • DEBUG - when deciding whether to parse a value as a short option, a long option, a subcommand or a positional parameter. TBD: debug message when a type converter is invoked?

remkop added a commit that referenced this issue Aug 20, 2017
remkop added a commit that referenced this issue Aug 21, 2017
- simplified system properties to just `picocli.trace`
- added isDebug, isInfo, isWarn
- added many debug-level tracing statements
- protect all debug logging with `isDebug` checks
remkop added a commit that referenced this issue Aug 22, 2017
* #158 added section on parser tracing
* #67 improved section on Map fields
* improved example application
remkop added a commit that referenced this issue Aug 22, 2017
* #158 added section on parser tracing
* #67 improved section on Map fields
* improved example application
@remkop
Copy link
Owner Author

remkop commented Aug 22, 2017

Todo: in INFO level traces, show the option or argument position index for which the field is modified. Update manual example to show only INFO traces.

@remkop remkop closed this as completed in 9a1fd44 Aug 23, 2017
remkop added a commit that referenced this issue Aug 25, 2017
…ittenOptionsAllowed=true); WARN for unmatched args (when isUnmatchedArgumentsAllowed=true)

- #158 use isWarn/isInfo/isDebug everywhere

Closes #171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant