Open benoit74 opened 10 months ago
We've found that a single name is enough in most scrapers so we use the name to distinguish our logs from the other dependencies. Here it should use gutenberg2zim
instead of the module name.
We could use different name base on file or module but it brings little value and make the logs very difficult to read because lines are not aligned (prefix size changes)
@benoit74 , I would like to implement this. Should I stick with keeping the module names or just use gutenberg2zim
as @rgaudin suggested?
Just use one name, gutenber2zim
as suggested by @rgaudin
And please adapt the code to create the logger with scraperlib getLogger
function like we try to harmonize among our codebase.
One good example of this approach is in offspot/demo:
getLogger
: https://github.com/offspot/demo/blob/669163c8bc864a0120ac8b31f3c8c73c57acb55e/src/offspot_demo/constants.py#L53Thank you!
In Gutenberg logs, only one logger
name
(gutenberg2zim.constants
) is used making it pretty useless.We should not log the
name
anymore and instead log the filename with%(filename)s
or module with%(module)s