Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@emk
Copy link
Contributor

@emk emk commented Nov 30, 2015

(Thank you for incorporating my earlier changes! Here's one more patch based on some bot testing.)

By default, the Slack adapter logs all Slack messages (including those
not acted on by handlers) to standard output. But when a chatbot's
output is being forwarded to a central logging service like papertrail,
this risks leaking or recording messages that should probably have
remained in Slack. In fact, Slack has a whole set of message-retention
tools that allow channel administrators to set policies:

https://slack.zendesk.com/hc/en-us/articles/203457187-Setting-up-custom-message-and-file-retention

Channel administrators with custom policies may object to bots which log
messages elsewhere.

To fix this, I demote one println! statement to debug!, using the
log crate. To access these logs from an app, see the notes about
setting up env_logger:

https://github.com/rust-lang-nursery/log

It would be possible to replace some of the other println! statements
in the chatbot module with debug! or info!, but I've left that up to
your choice. I didn't see any other println! statements that seemed
critical during a quick grep through the code.

By default, the Slack adapter logs all Slack messages (including those
not acted on by handlers) to standard output.  But when a chatbot's
output is being forwarded to a central logging service like papertrail,
this risks leaking or recording messages that should probably have
remained in Slack. In fact, Slack has a whole set of message-retention
tools that allow channel administrators to set policies:

https://slack.zendesk.com/hc/en-us/articles/203457187-Setting-up-custom-message-and-file-retention

Channel administrators with custom policies may object to bots which log
messages elsewhere.

To fix this, I demote one `println!` statement to `debug!`, using the
`log` crate.  To access these logs from an app, see the notes about
setting up `env_logger`:

https://github.com/rust-lang-nursery/log

It would be possible to replace some of the other `println!` statements
in the chatbot module with `debug!` or `info!`, but I've left that up to
your choice.  I didn't see any other `println!` statements that seemed
critical during a quick grep through the code.
@jwilm
Copy link
Owner

jwilm commented Dec 5, 2015

Oh shoot! Somehow missed this go by on my feed 😳. We should probably replace all of the println! statements with the log macros as you've suggested.

Looks like the test runner is messed up. I'll look into that. Do you want to update the rest of the println! statements, or should I just get this merged?

@emk
Copy link
Contributor Author

emk commented Sep 18, 2016

Please feel free to go ahead and update and/or merge this!

I finally ran into enough issues keeping a Slack connection open that I converted our internal stuff to a stateless Slack command invoked via HTTP, using an Iron-based server.

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

Successfully merging this pull request may close these issues.

2 participants