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

__init__.py 584 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
  1. import os
  2. import sys
  3. import logging
  4. # Define logging format
  5. logging_str = "[%(asctime)s: %(levelname)s: %(module)s: %(message)s]"
  6. # Define directory and file path for logs
  7. log_dir = "logs"
  8. log_filepath = os.path.join(log_dir, "running_logs.log")
  9. os.makedirs(log_dir, exist_ok=True)
  10. # Configure logging
  11. logging.basicConfig(
  12. level=logging.INFO,
  13. format=logging_str,
  14. handlers=[
  15. logging.FileHandler(log_filepath), # Log to file
  16. logging.StreamHandler(sys.stdout) # Log to stdout
  17. ]
  18. )
  19. # Get logger instance
  20. logger = logging.getLogger("mlProjectLogger")
Tip!

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

Comments

Loading...