From 9216f5ed4584203dab5270d00a43715cb3044d16 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Thu, 2 Apr 2015 13:51:24 +0200 Subject: [PATCH] Poulet --- serveur/Log.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/serveur/Log.py b/serveur/Log.py index 39cd80b..fbe099a 100755 --- a/serveur/Log.py +++ b/serveur/Log.py @@ -4,9 +4,11 @@ """ import logging +import os from logging.handlers import RotatingFileHandler + class bcolors: """ Define constant color value for different level @@ -62,6 +64,8 @@ class Log(object): error.log -> error Write all message on terminal too """ + if not os.path.exists("log"): + os.makedirs("log") self.logger = logging.getLogger() self.logger.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)-15s :: %(levelname)s :: %(message)s')