baidu / baidu/lac

请问如何取消日志在终端的打印?

Open
#102 6 comments 1 reaction 0 assignees View on GitHub
duplicate
Dominant language
C++
Stars
4k
Forks
592
PR merge metrics
No merged PRs in 30d

Description

我在调用LAC相关方法的时候,原本通过python logging模块写入日志文件的内容被打印到终端了,请问如何取消在终端的日志打印?
测试代码如下:
```
from LAC import LAC
import logging

logging.basicConfig(filename='testlog.log', filemode="a", format="%(asctime)s %(name)s:%(levelname)s:%(message)s", datefmt="%Y-%m-%d %H:%M:%S",level=logging.DEBUG)

logging.info('test lac log')
```

本应写进日志文件里的“test lac log”,在终端打印了出来,请问如何取消?谢谢!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Python example using LAC, logging.basicConfig, and testlog.log, then reproduce the unexpected terminal output. Trace how the LAC-related call configures or emits logging and determine the documented way to keep messages in the file only. Done means the example no longer prints the test message to the terminal while still writing it to testlog.log.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.