clog/main.py
theonepath a0e487a2a7
Updated main.py
Added another example of how to log with pseudologs
2022-05-03 18:12:59 +01:00

19 lines
555 B
Python

if __name__ == "__main__":
import _logger
import time
logger = _logger.Logger()
logger.debug("This is a debug message").withConsole()
logger.warn("This is a warning message").withConsole()
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()