Commit Graph

19 Commits

Author SHA1 Message Date
Mike Fährmann
ece73b5b2a make 'path' and 'keywords' available in logging messages
Wrap all loggers used by job, extractor, downloader, and postprocessor
objects into a (custom) LoggerAdapter that provides access to the
underlying job, extractor, pathfmt, and kwdict objects and their
properties.

__init__() signatures for all downloader and postprocessor classes have
been changed to take the current Job object as their first argument,
instead of the current extractor or pathfmt.

(#574, #575)
2020-05-18 19:04:51 +02:00
Mike Fährmann
11d3247c85 use 'util.Formatter' when formatting logging output 2020-05-10 00:09:06 +02:00
Mike Fährmann
4bc161ca0f prevent crash when sys.stdout and co. are None (#653) 2020-03-23 23:38:55 +01:00
Mike Fährmann
5cdf1b1319 fix --verbose/--quiet
caused by 383795b
2020-02-17 22:29:51 +01:00
Mike Fährmann
383795b550 prevent superfluous calls to Logger.makeRecord()
… by setting an appropriate minimal logging level for the root Logger.
2020-01-30 15:19:06 +01:00
Mike Fährmann
f5604492c3 update interface of config functions 2019-11-24 00:42:28 +01:00
Mike Fährmann
15e4ddf46d implement custom logging formatter
supports custom log message formats for each loglevel and, by
extension, custom ANSI codes and colors for errors and warnings

(#304)
2019-06-21 20:17:58 +02:00
Mike Fährmann
ae353ed3b0 provide "extractor" and "job" keys for logging output
This allows for stuff like "{extractor.url}" and "{extractor.category}"
in logging format strings.
Accessing 'extractor' and 'job' in any way will return "None" if those
fields aren't defined, i.e. in general logging messages.
2019-02-14 11:09:58 +01:00
Mike Fährmann
4810d446bb remove the obsolete safeprint() and error() functions
- safeprint() was used to print values which might have caused a
  UnicodeEncodeError, but that is no longer necessary (0381ae5)
- errors are now handled via logging output (f94e370)
2018-04-05 13:10:33 +02:00
Mike Fährmann
79bcaa8726 improve downloader retry behavior
- only retry download on 5xx and 429 status codes
- immediately fail on 4xx status codes
2017-11-10 21:46:18 +01:00
Mike Fährmann
701c016b97 add '-q/--quiet' option 2017-04-26 11:33:19 +02:00
Mike Fährmann
8d5f26d530 small fixes to the output module 2017-04-07 13:24:36 +02:00
Mike Fährmann
4f123b8513 code adjustments according to pep8 2017-01-30 19:40:15 +01:00
Mike Fährmann
91c446805b replace platform.system() with os.name 2016-10-25 15:44:36 +02:00
Mike Fährmann
810aa4e146 add a space after status indicators 2015-12-02 18:49:49 +01:00
Mike Fährmann
b2401542eb implement output.mode and .shorten options 2015-12-02 18:47:42 +01:00
Mike Fährmann
8d257510d0 rework output module 2015-12-02 16:48:23 +01:00
Mike Fährmann
d26eec8470 workarounds for windows console 2015-12-01 23:54:57 +01:00
Mike Fährmann
c786843a6f add output-module 2015-12-01 21:21:39 +01:00