Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

config.py 730 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  1. import logging
  2. from pathlib import Path
  3. level = "DEBUG"
  4. logfmt = "%(asctime)s: %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s"
  5. datefmt = "%Y-%m-%d:%H:%M:%S"
  6. # create auxiliary variables
  7. loggerName = Path(__file__).stem
  8. # create logging formatter
  9. logFormatter = logging.Formatter(
  10. fmt=logfmt, datefmt=datefmt
  11. )
  12. # create logger
  13. loglvl = getattr(logging, level)
  14. logger = logging.getLogger(loggerName)
  15. logger.setLevel(loglvl)
  16. consoleHandler = logging.StreamHandler()
  17. consoleHandler.setLevel(loglvl)
  18. consoleHandler.setFormatter(logFormatter)
  19. logger.addHandler(consoleHandler)
  20. # Terminal Color:
  21. class bcolors:
  22. HEADER = "\033[95m"
  23. WARNING = "\033[93m"
  24. FAIL = "\033[91m"
  25. ENDC = "\033[0m"
  26. BOLD = "\033[1m"
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...