-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef1d611
commit 4f52f20
Showing
5 changed files
with
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.6.1 | ||
6.6.1-alpha-1 |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import logging | ||
import boto3 | ||
|
||
from confidant import settings | ||
|
||
def init_logging(): | ||
logging.getLogger(__name__).info('Initializing logging') | ||
if not settings.get('DEBUG'): | ||
boto3.set_stream_logger(level=logging.CRITICAL) | ||
logging.getLogger('botocore').setLevel(logging.CRITICAL) | ||
logging.getLogger('pynamodb').setLevel(logging.WARNING) | ||
|
||
|
||
def get_logger(name=__name__): | ||
return logging.getLogger(name) | ||
|
||
|
||
def logging_abstraction(log_level='INFO', msg='', name=__name__): | ||
logger = get_logger(name) | ||
|
||
if log_level == 'INFO' and msg: | ||
logger.info(msg) | ||
elif log_level == 'ERROR' and msg: | ||
logger.error(msg) | ||
elif log_level == 'DEBUG' and msg: | ||
logger.debug(msg) | ||
elif log_level == 'CRITICAL' and msg: | ||
logger.critical(msg) | ||
elif log_level == 'WARNING' and msg: | ||
logger.warning(msg) |
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