Updated main.py
Added another example of how to log with pseudologs
This commit is contained in:
parent
5e922c5515
commit
a0e487a2a7
9
main.py
9
main.py
|
|
@ -1,5 +1,6 @@
|
|||
if __name__ == "__main__":
|
||||
import _logger
|
||||
import time
|
||||
|
||||
logger = _logger.Logger()
|
||||
|
||||
|
|
@ -8,3 +9,11 @@ if __name__ == "__main__":
|
|||
logger.error("This is an error message").withConsole()
|
||||
|
||||
logger.debug("A message to file but not TTY")
|
||||
|
||||
msg = "Checking if 1 + 1 = 2..."
|
||||
logger.debug(msg, end="\r").withConsole()
|
||||
time.sleep(1)
|
||||
if 1 + 2 != 2:
|
||||
logger.error(msg + "failed.").withConsole()
|
||||
else:
|
||||
logger.debug(msg + "ok.").withConsole()
|
||||
Loading…
Reference in New Issue
Block a user