MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / _log

Function _log

pipcl.py:3098–3109  ·  view source on GitHub ↗

Logs lines with prefix, if is lower or equal to .

(text, level, caller)

Source from the content-addressed store, hash-verified

3096 _log(text, 2, caller+1)
3097
3098def _log(text, level, caller):
3099 '''
3100 Logs lines with prefix, if <level> is lower or equal to <g_verbose>.
3101 ''&#x27;
3102 if level <= g_verbose:
3103 fr = inspect.stack(context=0)[caller]
3104 filename = relpath(fr.filename)
3105 for line in text.split('\n'):
3106 if g_log_line_numbers:
3107 print(f'{filename}:{fr.lineno}:{fr.function}(): {line}', file=sys.stdout, flush=1)
3108 else:
3109 print(f'{filename}:{fr.function}(): {line}', file=sys.stdout, flush=1)
3110
3111
3112def relpath(path, start=None, allow_up=True):

Callers 4

logFunction · 0.70
log0Function · 0.70
log1Function · 0.70
log2Function · 0.70

Calls 1

relpathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…