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__ = dict_proxy({'__module__': 'opslib.icslog', 'set_debug_level': <function set_debug_level at 0x31ea0c8>, 'warning': <function warning at 0x31ea500>, 'set_critical_level': <function set_critical_level at 0x31ea2a8>, '__dict__': <attribute '__dict__' of 'IcsLog' objects>, 'set_warning_level': <function set_warning_level at 0x31ea1b8>, '__weakref__': <attribute '__weakref__' of 'IcsLog' objects>, '__init__': <function __init__ at 0x31ea050>, 'info': <function info at 0x31ea488>, 'exception': <function exception at 0x31ea668>, '_lock': <function _lock at 0x31ea320>, '_unlock': <function _unlock at 0x31ea398>, 'set_info_level': <function set_info_level at 0x31ea140>, 'critical': <function critical at 0x31ea5f0>, 'error': <function error at 0x31ea578>, 'debug': <function debug at 0x31ea410>, '__doc__': '\n ICS Log Library\n ', 'set_error_level': <function set_error_level at 0x31ea230>})
-
__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]