MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / logger_debug

Function logger_debug

tensorrt_llm/llmapi/utils.py:106–120  ·  view source on GitHub ↗

Print the message if the llmapi debug mode is enabled. Fallback to logger.debug if not.

(message,
                 color: Optional[str] = None,
                 writer: io.TextIOWrapper = sys.stderr)

Source from the content-addressed store, hash-verified

104
105
106def logger_debug(message,
107 color: Optional[str] = None,
108 writer: io.TextIOWrapper = sys.stderr):
109 """ Print the message if the llmapi debug mode is enabled. Fallback to logger.debug if not. """
110 if enable_llmapi_debug():
111 timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
112 location = get_current_location()
113 cur_dualname = "..." + location[-47:] if len(
114 location) > 50 else location
115 print_colored(f"{timestamp} [{cur_dualname}]", "bold_green", writer)
116 print_colored(f" {message}\n", color, writer)
117 writer.flush()
118 else:
119 # Fallback to logger.debug
120 logger.debug(message)
121
122
123def file_with_glob_exists(directory, glob) -> bool:

Callers 15

test_tp1Method · 0.90
launch_server_mainFunction · 0.90
stop_server_mainFunction · 0.90
load_weightsMethod · 0.90
shutdownMethod · 0.90
main_taskMethod · 0.90
__init__Method · 0.85
saveMethod · 0.85
_build_engineMethod · 0.85
wrapperFunction · 0.85
_start_mpi_poolMethod · 0.85

Calls 4

enable_llmapi_debugFunction · 0.85
get_current_locationFunction · 0.85
print_coloredFunction · 0.85
debugMethod · 0.45

Tested by 2

test_tp1Method · 0.72