def dbg(*args): """ Looks at the stack, to see if a debug message should be printed. """ if debug_function and enable_notice: frm = inspect.stack()[1] mod = inspect.getmodule(frm[0]) if not (mod.__name__ in ignored_modules): debug_function(NOTICE, 'dbg: ' + ', '.join(u(a) for a in args))
def warning(*args): if debug_function and enable_warning: debug_function(WARNING, 'warning: ' + ', '.join(u(a) for a in args))