riga / law

Build large-scale task workflows: luigi + job submission + remote targets + environment sandboxing using Docker/Singularity
http://law.readthedocs.io
BSD 3-Clause "New" or "Revised" License
98 stars 41 forks source link

[rich] allow passing through kwargs to RichHandler #112

Closed pfackeldey closed 2 years ago

pfackeldey commented 2 years ago

Hi @riga,

this PR allows to pass kwargs down to the RichHandler. This is useful to e.g. disable time in logging by adding show_time=False. By default this is set to True and creates a rather ugly indentation: image However there are also other useful options, such as rich_tracebacks, which can be passed then to the RichHandler:

Example usage:

import law

law.contrib.load("rich")
law.rich.replace_console_handlers(show_time=False, rich_tracebacks=True)

Best, Peter

riga commented 2 years ago

LGTM! 🎉