diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-06-08 14:26:51 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-06-08 14:26:51 +0000 |
commit | 34aa84a8b01ede09a2e483a6db1201595c86ec96 (patch) | |
tree | d6d7078f44aa027d191a682905b5b33b6f2403a5 /subreddit.py | |
parent | 4db18513cbf647d5e9dd7a4c20266470c4752818 (diff) | |
download | SmallYTChannelBot-34aa84a8b01ede09a2e483a6db1201595c86ec96.tar.gz SmallYTChannelBot-34aa84a8b01ede09a2e483a6db1201595c86ec96.zip |
Switched to older logging system, added plotting
Diffstat (limited to 'subreddit.py')
-rwxr-xr-x | subreddit.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/subreddit.py b/subreddit.py index 4beeed6..f600d6f 100755 --- a/subreddit.py +++ b/subreddit.py @@ -27,28 +27,28 @@ FREE_FLAIRS = CONFIG["free_flairs"] IMGUR = ImgurClient(**CONFIG["imgurapi"]) -# logging.basicConfig( -# format = "%(process)s\t[%(asctime)s]\t%(message)s", -# level = logging.INFO, -# handlers=[ -# logging.FileHandler("actions.log"), -# logging.StreamHandler() -# ]) - -handler = logging.FileHandler("/logs/api.log") -handler.setLevel(logging.DEBUG) -handler.setFormatter(logging.Formatter("[%(asctime)s]\t%(message)s")) -for logger_name in ("praw", "prawcore"): - logger = logging.getLogger(logger_name) - logger.setLevel(logging.DEBUG) - logger.addHandler(handler) +logging.basicConfig( + format = "%(process)s\t[%(asctime)s]\t%(message)s", + level = logging.INFO, + handlers=[ + logging.FileHandler("actions.log"), + logging.StreamHandler() + ]) + +# handler = logging.FileHandler("/logs/api.log") +# handler.setLevel(logging.DEBUG) +# handler.setFormatter(logging.Formatter("[%(asctime)s]\t%(message)s")) +# for logger_name in ("praw", "prawcore"): +# logger = logging.getLogger(logger_name) +# logger.setLevel(logging.DEBUG) +# logger.addHandler(handler) def get_time(): return time.strftime("%b %d %Y %H:%M:%S", time.gmtime()) def display(message, concerning = None): - # logging.info(message) - print(message) + logging.info(message) + # print(message) #yes it'd be prettier to do this with a logging.Handler, but alas #due to `concerning` it'd be more complicated than doing it like this |