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

Function log

src/__init__.py:243–263  ·  view source on GitHub ↗

For development/debugging diagnostics.

( text='', caller=1)

Source from the content-addressed store, hash-verified

241 )
242
243def log( text='', caller=1):
244 '''
245 For development/debugging diagnostics.
246 '''
247 try:
248 stack = inspect.stack(context=0)
249 except StopIteration:
250 pass
251 else:
252 frame_record = stack[caller]
253 try:
254 filename = os.path.relpath(frame_record.filename)
255 except Exception: # Can fail on windows.
256 filename = frame_record.filename
257 line = frame_record.lineno
258 function = frame_record.function
259 text = f'{filename}:{line}:{function}(): {text}'
260 if _g_log_items_active:
261 _g_log_items.append(text)
262 if _g_out_log:
263 print(text, file=_g_out_log, flush=1)
264
265
266def message(text=''):

Callers 15

exception_infoFunction · 0.70
get_env_boolFunction · 0.70
get_env_intFunction · 0.70
__init__.pyFile · 0.70
filterMethod · 0.70
add_pdf_linksMethod · 0.70
fitMethod · 0.70
retMethod · 0.70
updateMethod · 0.70
appendMethod · 0.70
jm_lineart_fill_textFunction · 0.70
movetoMethod · 0.70

Calls 1

appendMethod · 0.45

Tested by 7

mainFunction · 0.40
buildFunction · 0.40
cibuildwheelFunction · 0.40
build_pyodide_wheelFunction · 0.40
testFunction · 0.40
venv_runFunction · 0.40