escale.log package¶
This package provides helpers and default configuration on top of the logging standard library.
Logs are concealed in a file which name can be defined in the configuration file. By default, the log file is named after the configuration file, with a .log extension.
Logs with priority INFO or higher are also dumped to the standard output.
-
exception
escale.log.ListenerAbort¶ Bases:
exceptions.Exception
escale.log.log module¶
-
exception
escale.log.log.ListenerAbort¶ Bases:
exceptions.Exception
-
class
escale.log.log.QueueListener(queue)¶ Bases:
escale.log.log.Listener-
queue¶
-
-
escale.log.log.flush_init_messages(logger, msgs)¶
-
escale.log.log.set_logger(config, cfg_file=None, verbosity=0, msgs=[])¶
escale.log.socket module¶
Borrowed from logging-cookbook.html#network-logging.
-
class
escale.log.socket.LogRecordStreamHandler(request, client_address, server)¶ Bases:
SocketServer.StreamRequestHandlerHandler for a streaming logging request.
This basically logs the record using whatever logging policy is configured locally.
-
handle()¶ Handle multiple requests - each expected to be a 4-byte length, followed by the LogRecord in pickle format. Logs the record according to whatever policy is configured locally.
-
handleLogRecord(record)¶
-
unPickle(data)¶
-
-
class
escale.log.socket.SocketListener(host='localhost', port=9020, handler=<class escale.log.socket.LogRecordStreamHandler>)¶ Bases:
escale.log.log.Listener,SocketServer.ThreadingTCPServerSimple TCP socket-based logging receiver suitable for testing.
-
allow_reuse_address= 1¶
-