72:e0e6043779e2 | 73:4f0e9cf8f230 |
---|---|
15 | 15 |
16 # | 16 # |
17 # Logging configuration | 17 # Logging configuration |
18 # | 18 # |
19 | 19 |
20 loglevel=logging.DEBUG | 20 loglevel=logging.INFO |
21 logfmt="%(asctime)s:%(levelname)s:%(name)s:%(message)s" | 21 logfmt="%(asctime)s:%(levelname)s:%(name)s:%(message)s" |
22 fifolog_capacity=1000 | 22 fifolog_capacity=1000 |
23 fifolog_fmt="%(asctime)s:%(levelname)s:%(message)s" | 23 fifolog_fmt="%(asctime)s:%(levelname)s:%(message)s" |
24 | 24 |
25 # | 25 # |
57 '--no-tray', | 57 '--no-tray', |
58 dest='notray', | 58 dest='notray', |
59 action='store_true', | 59 action='store_true', |
60 help='Do not show the tray icon') | 60 help='Do not show the tray icon') |
61 | 61 |
62 parser.add_argument( | |
63 '--debug', | |
64 dest='debug', | |
65 action='store_true', | |
66 help='Set logging level to debug') | |
67 | |
62 return parser.parse_args() | 68 return parser.parse_args() |
63 | 69 |
64 # | 70 # |
65 # Main routine | 71 # Main routine |
66 # | 72 # |
76 tray = None | 82 tray = None |
77 backups=[] | 83 backups=[] |
78 | 84 |
79 try: | 85 try: |
80 args=do_args() | 86 args=do_args() |
87 | |
88 if args.debug: | |
89 logger.setLevel(logging.DEBUG) | |
81 | 90 |
82 if not os.path.isdir(config.logs_dir): | 91 if not os.path.isdir(config.logs_dir): |
83 os.makedirs(config.logs_dir) | 92 os.makedirs(config.logs_dir) |
84 | 93 |
85 handler=logging.handlers.TimedRotatingFileHandler( | 94 handler=logging.handlers.TimedRotatingFileHandler( |