Permalink
Browse files

Fixed path to logdir on logger module

  • Loading branch information...
but3k4 committed Mar 19, 2011
1 parent 8054eb9 commit bfb1bcb1eccd075b3242cf3d1e0f236945141f6a
Showing with 3 additions and 2 deletions.
  1. +3 −2 modules/logger.py
View
@@ -6,7 +6,7 @@
Licensed under BSD License.
"""
from time import strftime
-from os.path import exists, join
+from os.path import abspath, dirname, exists, join
from os import makedirs
from sys import stdout
@@ -16,7 +16,8 @@ def __init__(self):
self.debug = 0
def __call__(self, string):
- logdir = join('log', strftime("%Y"), strftime("%m"))
+ path = '/'.join(dirname(abspath(__file__)).split('/')[:-1])
+ logdir = join(path, 'log', strftime("%Y"), strftime("%m"))
filename = "%s.log" % (join(logdir, strftime("%Y%m%d")))
string = "[ %s ] %s" % (strftime("%d/%m/%Y %H:%M:%S"), string)
if not exists(logdir):

0 comments on commit bfb1bcb

Please sign in to comment.