mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-27 12:44:19 +01:00
parent
63eb6672ea
commit
1f618b9773
@ -234,6 +234,7 @@ if __name__ == '__main__':
|
|||||||
print('Testing began at %s (pid %s)' % (time.ctime(), os.getpid()))
|
print('Testing began at %s (pid %s)' % (time.ctime(), os.getpid()))
|
||||||
if options.clean:
|
if options.clean:
|
||||||
shutil.rmtree(conf.supybot.directories.log())
|
shutil.rmtree(conf.supybot.directories.log())
|
||||||
|
log._mkDirs()
|
||||||
shutil.rmtree(conf.supybot.directories.conf())
|
shutil.rmtree(conf.supybot.directories.conf())
|
||||||
shutil.rmtree(conf.supybot.directories.data())
|
shutil.rmtree(conf.supybot.directories.data())
|
||||||
result = runner.run(suite)
|
result = runner.run(suite)
|
||||||
|
12
src/log.py
12
src/log.py
@ -176,15 +176,19 @@ class ColorizedFormatter(Formatter):
|
|||||||
else:
|
else:
|
||||||
return Formatter.format(self, record, *args, **kwargs)
|
return Formatter.format(self, record, *args, **kwargs)
|
||||||
|
|
||||||
_logDir = conf.supybot.directories.log()
|
def _mkDirs():
|
||||||
if not os.path.exists(_logDir):
|
global _logDir, pluginLogDir
|
||||||
|
_logDir = conf.supybot.directories.log()
|
||||||
|
if not os.path.exists(_logDir):
|
||||||
os.mkdir(_logDir, 0o755)
|
os.mkdir(_logDir, 0o755)
|
||||||
|
|
||||||
pluginLogDir = os.path.join(_logDir, 'plugins')
|
pluginLogDir = os.path.join(_logDir, 'plugins')
|
||||||
|
|
||||||
if not os.path.exists(pluginLogDir):
|
if not os.path.exists(pluginLogDir):
|
||||||
os.mkdir(pluginLogDir, 0o755)
|
os.mkdir(pluginLogDir, 0o755)
|
||||||
|
|
||||||
|
_mkDirs()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
messagesLogFilename = os.path.join(_logDir, 'messages.log')
|
messagesLogFilename = os.path.join(_logDir, 'messages.log')
|
||||||
_handler = BetterFileHandler(messagesLogFilename, encoding='utf8')
|
_handler = BetterFileHandler(messagesLogFilename, encoding='utf8')
|
||||||
|
Loading…
Reference in New Issue
Block a user