Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change format to be equal to default turbogears logging format

  • Loading branch information...
commit 5af01862582db0cc2b0d6e21eeb05708841be0ef 1 parent f875f83
Alessandro Molina amol- authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 gearbox/main.py
7 gearbox/main.py
View
@@ -6,6 +6,9 @@
from gearbox.utils.plugins import find_egg_info_dir
class GearBox(App):
+ LOG_DATE_FORMAT = '%H:%M:%S'
+ LOG_GEARBOX_FORMAT = '%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s'
+
def __init__(self):
super(GearBox, self).__init__(description="TurboGears2 Gearbox toolset",
version='2.3',
@@ -23,7 +26,7 @@ def configure_logging(self):
# Set up logging to a file
if self.options.log_file:
file_handler = logging.FileHandler(filename=self.options.log_file)
- formatter = logging.Formatter(self.LOG_FILE_MESSAGE_FORMAT)
+ formatter = logging.Formatter(self.LOG_GEARBOX_FORMAT, datefmt=self.LOG_DATE_FORMAT)
file_handler.setFormatter(formatter)
root_logger.addHandler(file_handler)
@@ -34,7 +37,7 @@ def configure_logging(self):
2: logging.DEBUG,
}.get(self.options.verbose_level, logging.DEBUG)
console.setLevel(console_level)
- formatter = logging.Formatter(self.CONSOLE_MESSAGE_FORMAT)
+ formatter = logging.Formatter(self.LOG_GEARBOX_FORMAT, datefmt=self.LOG_DATE_FORMAT)
console.setFormatter(formatter)
root_logger.addHandler(console)
Please sign in to comment.
Something went wrong with that request. Please try again.