aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-06-06 12:07:52 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2023-06-06 12:07:52 +0000
commit2625a7cf2100cd88d763fd421062a36dcb49d008 (patch)
treefb677bd650e431a41305d805dee8d2a9ca28c753
parente050e04eb999f94ceffbe733b73d5aa06dd82a2e (diff)
parent0cb69efde8e73a0331a267615f046b9d22579476 (diff)
downloadSmallYTChannelBot-2625a7cf2100cd88d763fd421062a36dcb49d008.tar.gz
SmallYTChannelBot-2625a7cf2100cd88d763fd421062a36dcb49d008.zip
Merge branch 'master' of git.eda.gay:SmallYTChannelBot
-rwxr-xr-x.gitignore1
-rwxr-xr-xdocker-compose.yml2
-rwxr-xr-xsubreddit.py24
3 files changed, 19 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 09dcb3e..2107721 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+logs/
login.py
graph.png
pid.txt
diff --git a/docker-compose.yml b/docker-compose.yml
index 9624bc9..4cd338c 100755
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -7,6 +7,8 @@ services:
dockerfile: Dockerfile
image: jwansek/smallytchannelbot
network_mode: host
+ volumes:
+ - ./logs/:/logs/
cron:
build:
context: .
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