litmus.logging
logging.py
Collection of logging functions in a handy inheritable class, to make it easier to edit later in one place
logger(out_stream=sys.stdout, err_stream=sys.stderr, verbose: Union[bool, int] = True, debug: Union[bool, int] = False, warn: Union[bool, int] = 0)
Object class that contains methods for printing to debug, verbose and error streams. Internal behaviour may change in future releases
Parameters:
Name | Type | Description | Default |
---|---|---|---|
out_stream
|
Stream to print run and debug messages to |
stdout
|
|
err_stream
|
Stream to print error messages to |
stderr
|
|
verbose
|
Union[bool, int]
|
Whether to print msg_run statements / lvl of reporting |
True
|
debug
|
Union[bool, int]
|
Whether to print msg_debug statements / lvl of reporting |
False
|
warn
|
Union[bool, int]
|
Whether to print msg_debug statements / lvl of warnings |
0
|
Source code in litmus/logging.py
out_stream = out_stream
instance-attribute
err_stream = err_stream
instance-attribute
verbose = verbose
instance-attribute
debug = debug
instance-attribute
warn = warn
instance-attribute
msg_err(*x: str, end: str = '\n', delim: str = ' ', lvl: int = 0)
Messages for when something has broken or been called incorrectly
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
str
|
string(s) to be printed |
()
|
end
|
str
|
string to be printed at end of the msg |
'\n'
|
delim
|
str
|
string to be printed at delimiter between messages |
' '
|
lvl
|
int
|
logging level. int >=0 |
0
|
Source code in litmus/logging.py
msg_run(*x: str, end: str = '\n', delim: str = ' ', lvl: int = 1)
Standard messages about when things are running
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
str
|
string(s) to be printed |
()
|
end
|
str
|
string to be printed at end of the msg |
'\n'
|
delim
|
str
|
string to be printed at delimiter between messages |
' '
|
lvl
|
int
|
logging level. int >=1 |
1
|
Source code in litmus/logging.py
msg_debug(*x: str, end: str = '\n', delim: str = ' ', lvl: int = 1)
Explicit messages to help debug when things are behaving strangely
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
str
|
string(s) to be printed |
()
|
end
|
str
|
string to be printed at end of the msg |
'\n'
|
delim
|
str
|
string to be printed at delimiter between messages |
' '
|
lvl
|
int
|
logging level. int >=1 |
1
|