Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
logger
#1
is there any way in python such that we can log in the logger file only when enable_log="true"
i have used a file handler to create a log file
Reply
#2
add file handler only if enable_log is True
or you can specify different levels, e.g. DEBUG for file handler
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Jun-27-2018, 01:33 PM)buran Wrote: add file handler only if enable_log is True or you can specify different levels, e.g. DEBUG for file handler
But adding file handler only if enable log is true diesnt work as i have passed logger as a function parameter also. It raises error there
Reply
#4
better show us your code
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  data push from logger to server asdfasdf 2 3,684 May-02-2017, 11:32 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020