smpl_debug.debug.msg

smpl_debug.debug.msg(msg, tag='', level=0, times=-1, line_=False, _back=0, **kwargs)[source]

Prints the message msg if level > debug_level and always returns the msg.

Parameters

tagstr

Sets a tag to be printed for the debug message.

levelint

Debug level.

timesint

How often should the message be printed if the function gets called multiple times (e.g. in a loop).

_linebool

Print the current line in the python source.

_backint

Number of stack/frames to go back.

Examples

>>> msg("hi", level = -9999)
DBG::<doctest smpl.debug.msg[0]>:1: hi
'hi'
>>> msg("hi")
'hi'