mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 23:35:07 +00:00
feat(prowler3): first commit
This commit is contained in:
23
lib/logger.py
Normal file
23
lib/logger.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import logging
|
||||
import sys
|
||||
|
||||
# Logging levels
|
||||
logging_levels = {
|
||||
"CRITICAL": logging.CRITICAL,
|
||||
"ERROR": logging.ERROR,
|
||||
"WARNING": logging.WARNING,
|
||||
"INFO": logging.INFO,
|
||||
"DEBUG": logging.DEBUG,
|
||||
}
|
||||
|
||||
# Initialize you log configuration using the base class
|
||||
# https://docs.python.org/3/library/logging.html#logrecord-attributes
|
||||
logging.basicConfig(
|
||||
stream=sys.stdout,
|
||||
format="%(asctime)s [File: %(filename)s] \t[Module: %(module)s]\t %(levelname)s: %(message)s",
|
||||
datefmt="%m/%d/%Y %I:%M:%S %p",
|
||||
)
|
||||
|
||||
# Retrieve the logger instance
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.ERROR)
|
||||
Reference in New Issue
Block a user