IcsLog Common Library

IcsLog: Library for Log

This is the IcsLog common library.
class opslib.icslog.IcsLog(name, console=True, logfile=None, level='DEBUG')[source]

ICS Log Library

__dict__ = <dictproxy object at 0x3d07b78>
__init__(name, console=True, logfile=None, level='DEBUG')[source]

Initialize the Ics Log

Parameters:
  • name (string) – the logger name, this param should be different for different loggers
  • console (int) – whether output the log to the console, value should be 0 or 1
  • logfile (string) – the file to save the logs
Return type:

class object

Returns:

a log object

__module__ = 'opslib.icslog'
__weakref__

list of weak references to the object (if defined)

_lock()[source]

Lock the file

_unlock()[source]

Unlock the file

critical(msg, *args, **kwargs)[source]

Logs a message with level critical on this logger.

Parameters:
  • msg (string) – message format string
  • args (arguments) – the arguments which are merged into msg using the string formatting operator
  • kwargs (not recommended to use) – not recommended to use
debug(msg, *args, **kwargs)[source]

Logs a message with level DEBUG on this logger.

Parameters:
  • msg (string) – message format string
  • args (arguments) – the arguments which are merged into msg using the string formatting operator
  • kwargs (not recommended to use) – not recommended to use
error(msg, *args, **kwargs)[source]

Logs a message with level error on this logger.

Parameters:
  • msg (string) – message format string
  • args (arguments) – the arguments which are merged into msg using the string formatting operator
  • kwargs (not recommended to use) – not recommended to use
exception(msg, *args, **kwargs)[source]

Logs a message with level exception on this logger.

Parameters:
  • msg (string) – message format string
  • args (arguments) – the arguments which are merged into msg using the string formatting operator
  • kwargs (not recommended to use) – not recommended to use
info(msg, *args, **kwargs)[source]

Logs a message with level info on this logger.

Parameters:
  • msg (string) – message format string
  • args (arguments) – the arguments which are merged into msg using the string formatting operator
  • kwargs (not recommended to use) – not recommended to use
set_critical_level()[source]

Sets the threshold for this logger to critical. Logging messages which are less severe than critical will be ignored.

set_debug_level()[source]

Sets the threshold for this logger to debug. Logging messages will all be printed.

set_error_level()[source]

Sets the threshold for this logger to error. Logging messages which are less severe than error will be ignored.

set_info_level()[source]

Sets the threshold for this logger to info. Logging messages which are less severe than info will be ignored.

set_warning_level()[source]

Sets the threshold for this logger to warning. Logging messages which are less severe than warning will be ignored.

warning(msg, *args, **kwargs)[source]

Logs a message with level warning on this logger.

Parameters:
  • msg (string) – message format string
  • args (arguments) – the arguments which are merged into msg using the string formatting operator
  • kwargs (not recommended to use) – not recommended to use
class opslib.icslog.NullHandler(level=0)[source]
__module__ = 'opslib.icslog'
emit(record)[source]

Indices and tables

Table Of Contents

Previous topic

IcsMeta Common Library

Next topic

IcsException Common Library

This Page