tickets_full: 55

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
55 2005-07-18 05:42:08 2007-07-03 23:03:50 2019-06-24 00:15:51.875254 Accepted closed Tools defect normal   wontfix add a logger to django insert the block into django.conf.settings file at line 32. {{{ #python a = me.SETTINGS_MODULE.split( '.' ) if 'settings' in a: idx = a.index( 'settings' ) if idx > 0: projname = a[idx-1] projmod = __import__( projname , '', '', ['']) else: projname = 'django' import django as projmod logdir = os.path.split( projmod.__file__ )[0] + os.sep + 'logs' if not os.access( logdir , os.W_OK ): raise 'Cannot write log file in dir: ' + logdir import logging logger = logging.getLogger( projname ) hdlr = logging.FileHandler( logdir + os.sep + projname + '.log' ) formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) logger.addHandler( hdlr ) logger.setLevel( logging.DEBUG ) __builtins__['log'] = logger log.info( 'project logger start' ) }}} make sure you have created 'logs' folder at your project or django src. then you can use log object anywhere. ATTENTION: NOT fully tested. adrian james log 0 0 0 0 0 0
Powered by Datasette · Query took 2.157ms