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

Insteon: Adjust Log Verbosity on a Per Device Basis #81

Closed
krkeegan opened this issue Feb 17, 2013 · 4 comments
Closed

Insteon: Adjust Log Verbosity on a Per Device Basis #81

krkeegan opened this issue Feb 17, 2013 · 4 comments

Comments

@krkeegan
Copy link
Collaborator

Revise log output to better assist debug as well as anomaly detection. This also includes the ability to adjust the verbosity level on a per-device (to include the plm) basis.
Request from Wikispaces

@krkeegan
Copy link
Collaborator Author

This still sounds nice, but I do not know how to implement it short of manually going through and finding every print_log entry and modifying it, which sounds daunting. I have a few ideas:

  1. Adjust print_log verbosity based on caller package. This is simple to implement as I can just add some logic to the print_log function. The results would be odd though, as an Insteon device is likely a Generic Item->Base Object->Base Light .... so only messages regarding code in the defined package would print. [As I write this I realize how dumb it is, forget this]
  2. Add a new print_log function in Generic_Item and switch all calls from ::print_log to $item->print_log. Should be a relatively easy find and replace. Now how should this work? If the per-device setting is an "override" only then the current
if $Debug{'Insteon'} >= 4;

can remain. In this design, all messages would be printed as per normal, but if a user defined a log_only_device setting, then only messages from that device that have a log level of the current debug or lower setting would be printed.

On the other hand, enabling a setting such as

Debug=Insteon:1, My_Kitchen_Light:4 

would be kind of cool. This would allow the logging of all Insteon messages up to level 1 but would log all messages for My_Kitchen_Light up to level 4. This would require more careful editing of the current print_log entries as the call to the print_log sub in Generic_Item would need to include multiple parameters.

What do other developers think? Usability should likely supersede coding difficulty, so take my whining with a grain of salt.

@pmatis
Copy link
Contributor

pmatis commented Oct 17, 2013

I have some ideas, and I'd like to take a stab at this. What's the best way for me to contribute and link the pull request to this issue?

Thanks!

@krkeegan
Copy link
Collaborator Author

If you add

#81

Into a comment in a commit, or a pull request, it will show up here in the discussion list.

@pmatis
Copy link
Contributor

pmatis commented Oct 19, 2013

I pushed a new commit, which should make it closer to final. I performed a bunch of scans, audits and syncs, then debugged. Stable so far. Still need to ensure that the most logical device is used for each call... but I'm not sure what every function does. Will have to look...

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