netromdk / slacker

Slacker - Easy access to the Slack API and admin of workspaces/teams.
MIT License
14 stars 0 forks source link

Feature/stream logger #39

Closed 0verbyte closed 6 years ago

0verbyte commented 6 years ago

Implements #38

This adds support for stdout logging via the Logger class. Slacker also accepts -q|--quiet to suppress stdout logging.

0verbyte commented 6 years ago

@netromdk updated and rebased. Config still logs messages, because the handler is registered within the class and not exposed. What do you think about just passing an argument to the config class to disable the stream handler in this case?

netromdk commented 6 years ago

Config still logs messages, because the handler is registered within the class and not exposed.

I'm not sure what you mean by the comment. If you call the static function that runs through all instances then you'll catch all of them.

0verbyte commented 6 years ago

I mean that within our config class, we setup a logger and log a message before the removeHandler can deregister that handler from logging the message. Example:

Notice that even with -q slacker will log to stdout.

% ./slacker.py -q
2018-02-03 15:02:30,105 - Config - INFO - Loaded config from: /Users/bdavis/.slacker
0xCoders>