All Samples(2522) | Call(2494) | Derive(0) | Import(28)
Do basic configuration for the logging system.
This function does nothing if the root logger already has handlers
configured. It is a convenience method intended for use by simple scripts
to do one-shot configuration of the logging package.
The default behaviour is to create a StreamHandler which writes to
sys.stderr, set a formatter using the BASIC_FORMAT format string, and
add the handler to the root logger.
A number of optional keyword arguments may be specified, which can alter
the default behaviour.
filename Specifies that a FileHandler be created, using the specified
filename, rather than a StreamHandler.
filemode Specifies the mode to open the file, if filename is specified
(if filemode is unspecified, it defaults to 'a').
format Use the specified format string for the handler.
datefmt Use the specified date/time format.
level Set the root logger level to the specified level.
stream Use the specified stream to initialize the StreamHandler. Note
that this argument is incompatible with 'filename' - if both
are present, 'stream' is ignored.
Note that you could specify a stream created using open(filename, mode)
rather than passing the filename and mode in. However, it should be
remembered that StreamHandler does not close its stream (since it may be
using sys.stdout or sys.stderr), whereas FileHandler closes its stream
when the handler is closed.
def basicConfig(**kwargs):
"""
Do basic configuration for the logging system.
This function does nothing if the root logger already has handlers
configured. It is a convenience method intended for use by simple scripts
to do one-shot configuration of the logging package.
The default behaviour is to create a StreamHandler which writes to
sys.stderr, set a formatter using the BASIC_FORMAT format string, and
add the handler to the root logger.
A number of optional keyword arguments may be specified, which can alter
the default behaviour.
filename Specifies that a FileHandler be created, using the specified
filename, rather than a StreamHandler.
filemode Specifies the mode to open the file, if filename is specified
(if filemode is unspecified, it defaults to 'a').
format Use the specified format string for the handler.
datefmt Use the specified date/time format.
level Set the root logger level to the specified level.
stream Use the specified stream to initialize the StreamHandler. Note
that this argument is incompatible with 'filename' - if both
are present, 'stream' is ignored.
Note that you could specify a stream created using open(filename, mode)
rather than passing the filename and mode in. However, it should be
remembered that StreamHandler does not close its stream (since it may be
using sys.stdout or sys.stderr), whereas FileHandler closes its stream
when the handler is closed.
"""
if len(root.handlers) == 0:
filename = kwargs.get("filename")
if filename:
mode = kwargs.get("filemode", 'a')
hdlr = FileHandler(filename, mode)
else:
stream = kwargs.get("stream")
hdlr = StreamHandler(stream)
fs = kwargs.get("format", BASIC_FORMAT)
dfs = kwargs.get("datefmt", None)
fmt = Formatter(fs, dfs)
hdlr.setFormatter(fmt)
root.addHandler(hdlr)
level = kwargs.get("level")
if level is not None:
root.setLevel(level)
#Configure logging
LOGDIR = os.path.abspath(os.path.dirname(__file__))
LOGFILE = "satchmo.log"
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename=os.path.join(LOGDIR, LOGFILE),
src/p/y/python-ogre-HEAD/trunk/python-ogre/demos/SampleFramework.py python-ogre(Download)
def setupLogging (logfilename="demo.log", logidentifier='PythonOgre.Demo'):
global logger
# set up logging to file
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
filename=logfilename,
src/p/y/python-ogre-HEAD/python-ogre/demos/SampleFramework.py python-ogre(Download)
def setupLogging (logfilename="demo.log", logidentifier='PythonOgre.Demo'):
global logger
# set up logging to file
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
filename=logfilename,
src/n/o/notmm-0.4.1/examples/satchmo_store/contrib/satchmo/projects/skeleton/local_settings.py notmm(Download)
#Configure logging
LOGFILE = "satchmo.log"
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename=os.path.join(DIRNAME,LOGFILE),
src/n/o/notmm-0.4.1/examples/lib/satchmo_store/settings.py notmm(Download)
#Configure logging
LOGFILE = "satchmo.log"
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename=os.path.join(DIRNAME,LOGFILE),
src/n/o/notmm-0.4.1/examples/satchmo_store/local_settings.py notmm(Download)
#Configure logging
LOGFILE = "satchmo.log"
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename=os.path.join(DIRNAME,LOGFILE),
src/m/u/multitelnet-HEAD/tag/milestone1/wxConsoleControlAutoCodeGenSample.py multitelnet(Download)
#Boa:Frame:frameUsedForAutoCodeGen import wx import wx.stc import logging logging.basicConfig(level=logging.DEBUG,
src/m/u/multitelnet-HEAD/branch/dev-dan/wxConsoleControlAutoCodeGenSample.py multitelnet(Download)
#Boa:Frame:frameUsedForAutoCodeGen import wx import wx.stc import logging logging.basicConfig(level=logging.DEBUG,
src/m/u/multitelnet-HEAD/trunk/wxConsoleControlAutoCodeGenSample.py multitelnet(Download)
#Boa:Frame:frameUsedForAutoCodeGen import wx import wx.stc import logging logging.basicConfig(level=logging.DEBUG,
src/m/u/multitelnet-HEAD/wxConsoleControlAutoCodeGenSample.py multitelnet(Download)
#Boa:Frame:frameUsedForAutoCodeGen import wx import wx.stc import logging logging.basicConfig(level=logging.DEBUG,
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next