Fix for logging
This commit is contained in:
parent
01003f7a2a
commit
54923788c7
3
.gitignore
vendored
3
.gitignore
vendored
@ -110,3 +110,6 @@ venv.bak/
|
|||||||
|
|
||||||
/src/config/Config.json
|
/src/config/Config.json
|
||||||
/src/config/PrivateConfig.json
|
/src/config/PrivateConfig.json
|
||||||
|
|
||||||
|
# Ignore dockerfiles
|
||||||
|
docker-compose.yml
|
||||||
@ -16,7 +16,7 @@ from discord.ext import commands
|
|||||||
|
|
||||||
from src.config.config import LoadConfig
|
from src.config.config import LoadConfig
|
||||||
from src.shared_libs.loggable import Loggable
|
from src.shared_libs.loggable import Loggable
|
||||||
from src.shared_libs.ioutil import in_here
|
from src.shared_libs.ioutils import in_here
|
||||||
|
|
||||||
|
|
||||||
# Init logging to output on INFO level to stderr.
|
# Init logging to output on INFO level to stderr.
|
||||||
@ -53,7 +53,7 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable):
|
|||||||
for cog in cogs:
|
for cog in cogs:
|
||||||
# Could this just be replaced with `strip()`?
|
# Could this just be replaced with `strip()`?
|
||||||
cog = cog.replace('\n', '')
|
cog = cog.replace('\n', '')
|
||||||
self.load_extension(f'{__name__}.cogs.{cog}')
|
self.load_extension(f'src.cogs.{cog}')
|
||||||
self.logger.info(f'Loaded: {cog}')
|
self.logger.info(f'Loaded: {cog}')
|
||||||
|
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
@ -93,11 +93,9 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
client = SebiMachine()
|
||||||
client = SebiMachine()
|
# Make sure the key stays private.
|
||||||
# Make sure the key stays private.
|
# I am 99% certain this is valid!
|
||||||
# I am 99% certain this is valid!
|
with open(in_here('config', 'PrivateConfig.json')) as fp:
|
||||||
with open(f'{__name__}/config/PrivateConfig.json') as fp:
|
|
||||||
PrivateConfig = json.load(fp)
|
PrivateConfig = json.load(fp)
|
||||||
|
client.run(PrivateConfig["bot-key"])
|
||||||
client.run(PrivateConfig["bot-key"])
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user