aboutsummaryrefslogtreecommitdiffstats
path: root/subreddit.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-06-06 13:06:06 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2023-06-06 13:06:06 +0100
commit0cb69efde8e73a0331a267615f046b9d22579476 (patch)
tree47e0f5966d364565e72e2c91a16d4fd45f8d10b2 /subreddit.py
parent790ca4d3083f8226360dc6eebe35a454f317bb15 (diff)
downloadSmallYTChannelBot-0cb69efde8e73a0331a267615f046b9d22579476.tar.gz
SmallYTChannelBot-0cb69efde8e73a0331a267615f046b9d22579476.zip
Added API logging
Diffstat (limited to 'subreddit.py')
-rwxr-xr-xsubreddit.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/subreddit.py b/subreddit.py
index 497359f..e92c1d9 100755
--- a/subreddit.py
+++ b/subreddit.py
@@ -27,19 +27,27 @@ 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()
- ])
+# 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)
+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)
+ # 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