-
Notifications
You must be signed in to change notification settings - Fork 13
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
(enhancement): use python's logger instead of prints #11
Comments
And allow the user to stdout (by default), or save to a log using a cmd parameter. |
… present: 1. added logger at module level 2. replace print statement by correspoding logging statement: info, warning, error and debug (for commented prints)
@cvandeplas I did a first print replacement in the commit above. But now we need to change a couple of things, that I think they deserve discussion.
|
1. another demo parser?? 2. get_result method when using cached results
…onsole only as per cmd parameter (configured by default to WARNING). File logging rules: - JSONL format. Note: Still breaks if double quotes added to the message. - File per execution (analyse, parse), per case.
I reverted a bit the mechanism suggested by @cvandeplas : it logs by default to jsonl (still breaks with double quotes) to any detail (INFO level), but it only logs to Console to the level defined by the cmd parameter. Why? Because it behaves in the exact same way than parsers and analysers and because if there are long running parsing/analysing executions, you may want to see the details in a file on later stage (automation [wink]). However, unlike parsers and analysers that they only keep the last execution output, a new JSONL file is generated with every new execution. |
…nd removing case_id from the filename.
…parameter resides. That is, available to all modes
Implements #11 - JSONL logging instead of printing to stdout
TBD if we want to use python's logger. That's a clearer way to separate log messages from print messages.. Related to #10 however, since the logger prefers late bindings and not f-strings.
The text was updated successfully, but these errors were encountered: