At Monday 11/12/2006 22:32, johnny wrote:
def setupLogging():
global log
log = logging.getLogger("ftp")
Also, there is no need to use a global here. The logging machinery
will return always the same logger given the same name. So
logging.getLogger("ftp") will be always the same.
logging.FileHandler('py_mybase.log')
fhnd.setLevel(logging.DEBUG)
log.addHandler(fhnd)
My Error:
log.setFormatter(formatter)
AttributeError: Logger instance has no attribute 'setFormatter'
If you look for setFormatter in the Python docs, you find that it is
an attribute o
x27;%(name)-12s: %(levelname)-8s
%(message)s')
log.setFormatter(formatter)
log.setLevel(logging.DEBUG)
fhnd = logging.FileHandler('py_mybase.log')
fhnd.setLevel(logging.DEBUG)
log.addHandler(fhnd)
My Error:
log.setFormatter(formatter)
AttributeError: Lo