Skip to content

Commit

Permalink
Delegate system logging to coloredlogs
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Mar 20, 2016
1 parent be12f90 commit 206d90b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions rotate_backups/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rotate-backups: Simple command line interface for backup rotation.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: July 19, 2015
# Last Change: March 20, 2016
# URL: https://github.com/xolox/python-rotate-backups

"""
Expand Down Expand Up @@ -97,7 +97,6 @@
# Standard library modules.
import getopt
import logging
import logging.handlers
import os
import sys

Expand All @@ -115,11 +114,7 @@

def main():
"""Command line interface for the ``rotate-backups`` program."""
coloredlogs.install()
if os.path.exists('/dev/log'):
handler = logging.handlers.SysLogHandler(address='/dev/log')
handler.setFormatter(logging.Formatter('%(module)s[%(process)d] %(levelname)s %(message)s'))
logger.addHandler(handler)
coloredlogs.install(syslog=True)
# Command line option defaults.
config_file = None
dry_run = False
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'rotate-backups = rotate_backups.cli:main'
]),
install_requires=[
'coloredlogs >= 0.5',
'coloredlogs >= 5.0',
'executor >= 1.3',
'humanfriendly >= 1.44.5',
'naturalsort >= 1.4',
Expand Down

0 comments on commit 206d90b

Please sign in to comment.