-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from CaravanaCloud:merge_config
Merge_config
- Loading branch information
Showing
4 changed files
with
117 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
import sys | ||
import logging | ||
from .config import get_log_level | ||
from rich.logging import RichHandler | ||
|
||
TRACE = 5 | ||
|
||
def init_logging(): | ||
sys.set_int_max_str_digits(999999) | ||
level = get_log_level() | ||
logging.basicConfig(stream=sys.stderr, level=level) | ||
print("Initializing logging with level "+str(level)) | ||
logging.basicConfig( | ||
level=level | ||
) | ||
#TODO: Configure rich log handler | ||
# https://rich.readthedocs.io/en/stable/logging.html | ||
log = logging.getLogger("up") | ||
log.setLevel(level) | ||
# print("Testing logging PRINT at level "+str(level)) | ||
# log.info("Testing logging INFO at level "+str(level)) | ||
# log.error("Testing logging ERROR at level "+str(level)) | ||
# log.debug("Testing logging DEBUG at level "+str(level)) | ||
# log.warning("Testing logging WARNING at level "+str(level)) | ||
return log | ||
|
||
log = init_logging() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters