# Own modules
from fb_tools.common import pp, to_bytes, to_bool
+from fb_tools.colored import ColoredFormatter
from fb_tools.handler import BaseHandler
from fb_tools.errors import FbAppError, FunctionNotImplementedError
from fb_tools.app import BaseApplication
else:
format_str += '%(name)s '
format_str += '%(levelname)s - %(message)s'
- formatter = logging.Formatter(format_str)
+ if not self.is_cgi and self.terminal_has_colors:
+ formatter = ColoredFormatter(format_str)
+ else:
+ formatter = logging.Formatter(format_str)
return formatter