Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SOLUTION A
- ========================
- create a function that check the status of the debug flag...
- #create a global var like this:
- DEBUG = True
- def debug_logger(s)
- if DEBUG: write_to_log(s)
- def functionA()
- debug_logger("write this message to the log file")
- SOLUTION B
- ========================
- have each function that needs to log something check the status of the flag directly
- #create a global var like this:
- DEBUG = True
- def functionA()
- if DEBUG: write_to_log("write this message to the log file")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement