[logger] fix tests

This commit is contained in:
Rushabh Mehta 2016-09-29 11:44:07 +05:30
parent 527115ce07
commit e091005b00
2 changed files with 3 additions and 2 deletions

View file

@ -1246,7 +1246,7 @@ log_level = None
def logger(module=None, with_more_info=True):
'''Returns a python logger that uses StreamHandler'''
from frappe.utils.logger import get_logger
return get_logger(module or __name__, with_more_info=with_more_info)
return get_logger(module or 'default', with_more_info=with_more_info)
def get_desk_link(doctype, name):
return '<a href="#Form/{0}/{1}" style="font-weight: bold;">{2} {1}</a>'.format(doctype, name, _(doctype))

View file

@ -1,6 +1,7 @@
from __future__ import unicode_literals
import frappe
import logging
from logging.handlers import RotatingFileHandler
default_log_level = logging.DEBUG
LOG_FILENAME = '../logs/frappe.log'
@ -12,7 +13,7 @@ def get_logger(module, with_more_info=True):
formatter = logging.Formatter('[%(levelname)s] %(asctime)s | %(pathname)s:\n%(message)s')
# handler = logging.StreamHandler()
handler = logging.handlers.RotatingFileHandler(
handler = RotatingFileHandler(
LOG_FILENAME, maxBytes=20000, backupCount=20)
handler.setFormatter(formatter)