NVIDIA / NVIDIA/TensorRT-Edge-LLM

Add an option to control log output

Open
#43 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
563
Forks
135
Avg merge
14h 13m
Merged PRs (30d)
1

Description

Detailed description of the requested feature

As of today, the logger prints either to std::cerr (error, warning) or std::cout (info, debug, ...):
https://github.com/NVIDIA/TensorRT-Edge-LLM/blob/8fe7fe102ee0644b02dfc69afc64ff178101cdae/cpp/common/logger.h#L102

There is no option to control the sink to disabled all logs, to log all to std cerr, to log all to std cout.
I would propose to add an environment variable to control the sink output eg:
TRTELLM_LOG_OUTPUT = cerr|cout|null

Timeline

As today this is a blocker because when the user does not want to show any log to end users while being able to redirect to an internal encrypted log.

Describe alternatives you've considered
  • redirecting the output (1|2 > /dev/null) but that is not an option when delivering a sdk/library, not an executable.
  • a log callback: this will be the best option and open to implement it if you are interested

Best

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read cpp/common/logger.h around line 102 to understand the current std::cerr and std::cout routing. Implement and verify the requested TRTELLM_LOG_OUTPUT behavior for cerr, cout, and null, with logging disabled or directed to the selected stream as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.