mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 06:45:08 +00:00
* chore(assuming role): assume role logic and exceptions demo * chore(exceptions): Exception handling * fix(get_caller_identity): Deleted duplicate get_caller_identity and add info entries * chore(creds renewal): Added support to credential renewal * chore(assume options): Added condition for -I/-T options * fix(typo/comments): Deleted f in logger config and comments * chore(session_duration): limits for -T option * fix(log messages): Changed -A/-R log messages * fix(critical error): Errors in input options are critical * fix(ClientError): IAM service ClientError exception support
24 lines
624 B
Python
24 lines
624 B
Python
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:%(lineno)d] \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)
|