NVIDIA / NVIDIA/TensorRT-Edge-LLM
Add an option to control log output
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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