python-rtmbot icon indicating copy to clipboard operation
python-rtmbot copied to clipboard

Allow Advanced Logging Configuration

Open ericparton opened this issue 9 years ago • 3 comments

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Description

Currently, all logging is done to the file specified by LOGFILE, which is configurable. It would be useful to allow more advanced logging configurations via python logging configuration files, as shown here in the python documentation.

Reproducible in:

  • [x] This is reproducible in the sample project. RTMBot version: 0.4.0 Python version: 2.7.11 OS Version: All

ericparton avatar Dec 05 '16 19:12 ericparton

+1 It would be nice to have access to a logger within plugins.

onlyanegg avatar Aug 12 '17 17:08 onlyanegg

@onlyanegg we can use python logging to log lines something like the following. You have to just import logging at the top of your python script.

logging.info("Got {} Records".format(len(records)))

And you can get the following log entry

2018-04-17 17:58:03,001 Got 2 Records

pbdabholkar avatar Apr 17 '18 13:04 pbdabholkar

This library could use a lot more debug and other logging. I'd prefer it to inherit the app's default logger than implement a logger specific to this package. I've also been adding logging to the underlying slackclient library which will enable more logging within rtmbot.

Roach avatar May 29 '18 23:05 Roach