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

Per-session log file #32

Open
Aezore opened this issue Jun 22, 2018 · 3 comments
Open

Per-session log file #32

Aezore opened this issue Jun 22, 2018 · 3 comments

Comments

@Aezore
Copy link

Aezore commented Jun 22, 2018

I suggest adding an appended log recorder, like a blackbox with datetimed results and user actions, with an user-setting for "how big" the log should be and trim it if needed. So in case you need to review some data or behaviour not within the session but another day or week even..as far as the log file size is set, in plain human readable text. This might be helpful as it really comes in handy sometimes on my Dataman chip programmer to actually double check if I did program a chip in the past and what data was loaded into.

@kasperkarlsson
Copy link
Contributor

This sounds like a nice feature, which could be really useful for users who make many or longer runs.

Logging e.g. script arguments, start time, end time, result summary, reason for quitting etc would give a nice, basic event log for each session. This could even be controlled by a log level value in a configuration file, so that the behavior can be persistently controlled without having to pass a log level argument each time CC is run. This would also be a reasonable place to set the maximum log size.

I like the idea. Any additional thoughts or input on this proposal are of course welcome.

@Aezore
Copy link
Author

Aezore commented Jun 25, 2018

It can be set in the .canrc config file as a "log verbosity" level.
I propose this keys:
[logging]
reportlevel = FULL/MIN/ERROR/NONE
reportsize =
reportfile = SESSION/APPEND

  • As report levels for FULL would be full timestamped canbus settings (as canbus speed and protocol), commands and results, errors, and some other minor system related stuff like kernel version and stuff like that. MIN would be timestamped discovered addresses or commands issued and if they were successful or not. ERROR would be just errors like no communications, canbus errors, and other related stuff.

  • Size I think it would be nice to be suffix-sensitive as 16M in megabytes.

  • File would mean if it creates just a single job report with all sessions appended or one log file for each session.

@kasperkarlsson
Copy link
Contributor

Since .canrc is not specific to Caring Caribou (but rather belongs to the underlying python-can library), we should not be modifying its contents. I would prefer a configuration file located within the project itself.

It would make sense to utilize the logging python module to handle different log levels. This way, the setting from the configuration file could simply be used to initiate a call with a matching level to logging.setLevel

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

2 participants