Skip to content

Commit

Permalink
Set better system log message (for macOS)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsh committed Mar 11, 2017
1 parent fb5981d commit deb6683
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/xirvik-start-torrents
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ if __name__ == '__main__':
syslogh = SysLogHandler(address='/dev/log')
except (OSError, socket.error):
syslogh = SysLogHandler(address='/var/run/syslog')
logging.INFO = logging.WARNING

syslogh.setFormatter(logging.Formatter('%(message)s'))
syslogh.setFormatter(logging.Formatter('%(name)s[%(process)d]: %(message)s'))
syslogh.setLevel(logging.DEBUG if args.debug else logging.INFO)
log.addHandler(syslogh)

try:
user, _, password = netrc(args.netrc_path).authenticators(args.host[0])
except TypeError:
log.error('Cannot find host {} in netrc'.format(args.host[0]))
log.exception('Cannot find host {} in netrc'.format(args.host[0]))
sys.exit(1)

post_url = ('https://{host:s}:{port:d}/rtorrent/php/'
Expand Down

0 comments on commit deb6683

Please sign in to comment.