Skip to content

Commit 7acb905

Browse files
committed
Fix: folder creation before init logging
1 parent 729b34b commit 7acb905

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/log_setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import os
12
import logging
23

4+
# path for databases or config files
5+
if not os.path.exists('data/'):
6+
os.mkdir('data/')
7+
38
# set logging format
49
formatter = logging.Formatter("[{asctime}] [{levelname}] [{name}] {message}", style="{")
510

@@ -19,4 +24,4 @@
1924

2025
# register loggers
2126
logger.addHandler(file_logger)
22-
logger.addHandler(console_logger)
27+
logger.addHandler(console_logger)

src/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
https://github.com/nonchris/discord-bot
1414
"""
1515

16-
# path for databases or config files
17-
if not os.path.exists('data/'):
18-
os.mkdir('data/')
19-
2016
intents = discord.Intents.all()
2117
bot = commands.Bot(command_prefix=PREFIX, intents=intents)
2218

0 commit comments

Comments
 (0)