forked from raystack/transformers
-
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.
* feat: add retry timeout * feat: upgrade bigquery client version + add timeout as a predicate to retry * feat: rename retry config env * feat: include SSLError as error worth to retry * feat: add log level config * fix: assigned retry object
- Loading branch information
1 parent
fe52f52
commit 2e20092
Showing
5 changed files
with
57 additions
and
11 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,11 +1,16 @@ | ||
import sys | ||
import logging | ||
import os | ||
|
||
def get_log_level(): | ||
log_level = str(os.environ.get("LOG_LEVEL", default="INFO")).upper() | ||
log_level = log_level if log_level in logging._nameToLevel else "INFO" | ||
return logging._nameToLevel.get(log_level) | ||
|
||
def get_logger(name: str): | ||
logger = logging.getLogger(name) | ||
logformat = "[%(asctime)s] %(levelname)s:%(name)s: %(message)s" | ||
logging.basicConfig(level=logging.INFO, stream=sys.stdout, | ||
logging.basicConfig(level=get_log_level(), stream=sys.stdout, | ||
format=logformat, datefmt="%Y-%m-%d %H:%M:%S") | ||
|
||
return logger |
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