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

Logging improvements #20

Open
mitchcapper opened this issue Apr 14, 2017 · 0 comments
Open

Logging improvements #20

mitchcapper opened this issue Apr 14, 2017 · 0 comments

Comments

@mitchcapper
Copy link
Contributor

I think it would be good to update the logging functionality a bit. I would like to add some more diagnostic logging functions (ie for events etc).

There are a few console.log's in places and then sendDebugMessage as well. I think it might be good to add a central logging function that takes the message and the log level. There would then be two configurable variables I see:
SLACK_LOG_LEVEL, CONSOLE_LOG_LEVEL
that specifies what logging to do to each.
Technically we could also just do one LOG_LEVEL variable and then use the existing DEBUG_MESSAGES env variable to determine if we send the logs to slack. This gives better back compat but sacrifices functionality. Other option is to use the two new variables and then just in code set SLACK_LOG_LEVEL to something reasonable if DEBUG_MESSAGES is specified.

I would recommend something along the lines of CRIT,ERROR,WARN,INFO,DEBUG.

DEBUG would dump all events, and we would now allow SLACK_LOG_LEVEL to be set that high (otherwise a nice loop where informing of the slack message sent would generate another sent message;).

Once we have a design direction I can submit a PR (will wait for some other items first.

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

No branches or pull requests

1 participant