-
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.
Added logging to cozy to show progress
- Loading branch information
Showing
5 changed files
with
69 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import logging | ||
|
||
logger = logging.getLogger('cozy-log') | ||
def disable(): | ||
""" | ||
Disable cozy logging | ||
""" | ||
logger.setLevel(logging.NOTSET) | ||
|
||
def set_level(level): | ||
""" | ||
Set the level of logging | ||
""" | ||
logger.setLevel(level) | ||
|
||
def info(*args, **kwargs): | ||
""" | ||
Log at the info level | ||
""" | ||
logger.info(*args, **kwargs) | ||
|
||
def warning(*args, **kwargs): | ||
""" | ||
Log at the warning level | ||
""" | ||
logger.warning(*args, **kwargs) | ||
|
||
def error(*args, **kwargs): | ||
""" | ||
Log at the error level | ||
""" | ||
logger.error(*args, **kwargs) | ||
|
||
def debug(*args, **kwargs): | ||
""" | ||
Log at the debug level | ||
""" | ||
logger.debug(*args, **kwargs) | ||
|
||
def critical(*args, **kwargs): | ||
""" | ||
Log at the critical level | ||
""" | ||
logger.critical(*args, **kwargs) | ||
|
||
set_level(logging.DEBUG) |
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