-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
my.core.logging: compatibility with HPI_LOGS
re-adds a removed check for HPI_LOGS, add some docs fix the checks for browserexport/takeout logs to use the computed level from my.core.logging
- Loading branch information
Showing
8 changed files
with
47 additions
and
20 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
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,11 +1,12 @@ | ||
import os | ||
from my.core import make_logger | ||
from my.core.util import __NOT_HPI_MODULE__ | ||
|
||
|
||
def _patch_browserexport_logs(): | ||
# patch browserexport logs if HPI_LOGS is present | ||
if "HPI_LOGS" in os.environ: | ||
from browserexport.log import setup as setup_browserexport_logger | ||
from my.core.logging import mklevel | ||
def _patch_browserexport_logs(module_name: str): | ||
# get the logger for the module this is being called from | ||
module_logger = make_logger(module_name) | ||
|
||
setup_browserexport_logger(mklevel(os.environ["HPI_LOGS"])) | ||
# grab the computed level (respects LOGGING_LEVEL_ prefixes) and set it on the browserexport logger | ||
from browserexport.log import setup as setup_browserexport_logger | ||
|
||
setup_browserexport_logger(module_logger.level) |
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
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