Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging and writing to the console

Status
Not open for further replies.

socrates200X

Programmer
Aug 14, 2006
2
US
I'm using the logging module in a GUI I'm developing. I've set up a FileHandler to write all logs above a certain level to a log file. However, while it does this fine, it also prints the log message to the console, which is undesired. (The whole purpose of my using the FileHandler is to *reduce* console clutter!) Is there any way to just write log messages to file and not to the screen using the logging module?

-- Ricardo Gonzalez
 
Found the answer. Just don't call basicConfig(); it'll auto-magically set up a StreamHandler that writes to the console.

--RG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top