forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/raft-tech/TANF-app into …
…2664-ext-msg-2
- Loading branch information
Showing
16 changed files
with
163 additions
and
13 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""Contains core logging functionality for TDP.""" | ||
|
||
import logging | ||
|
||
class ColorFormatter(logging.Formatter): | ||
"""Simple formatter class to add color to log messages based on log level.""" | ||
|
||
BLACK = '\033[0;30m' | ||
RED = '\033[0;31m' | ||
GREEN = '\033[0;32m' | ||
BROWN = '\033[0;33m' | ||
BLUE = '\033[0;34m' | ||
PURPLE = '\033[0;35m' | ||
CYAN = '\033[0;36m' | ||
GREY = '\033[0;37m' | ||
|
||
DARK_GREY = '\033[1;30m' | ||
LIGHT_RED = '\033[1;31m' | ||
LIGHT_GREEN = '\033[1;32m' | ||
YELLOW = '\033[1;33m' | ||
LIGHT_BLUE = '\033[1;34m' | ||
LIGHT_PURPLE = '\033[1;35m' | ||
LIGHT_CYAN = '\033[1;36m' | ||
WHITE = '\033[1;37m' | ||
|
||
RESET = "\033[0m" | ||
|
||
def __init__(self, *args, **kwargs): | ||
self._colors = {logging.DEBUG: self.CYAN, | ||
logging.INFO: self.GREEN, | ||
logging.WARNING: self.YELLOW, | ||
logging.ERROR: self.LIGHT_RED, | ||
logging.CRITICAL: self.RED} | ||
super(ColorFormatter, self).__init__(*args, **kwargs) | ||
|
||
def format(self, record): | ||
"""Format the record to be colored based on the log level.""" | ||
return self._colors.get(record.levelno, self.WHITE) + super().format(record) + self.RESET |
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
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
Oops, something went wrong.