Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to override the default formatting #27

Open
lamby opened this issue Mar 13, 2018 · 1 comment
Open

Make it easier to override the default formatting #27

lamby opened this issue Mar 13, 2018 · 1 comment

Comments

@lamby
Copy link
Contributor

lamby commented Mar 13, 2018

Hey,

I really love how you can just do daiquiri.setup() and then just Move On. However, as soon as I would like to change the formatting (ie. drop the process ID and log name as it's always the same) then I end up having something relatively ugly:

formatter = daiquiri.formatter.ColorExtrasFormatter(
   fmt="%(color)s%(levelname).1s: %(message)s%(color_stop)s"
)

daiquiri.setup(outputs=(
    daiquiri.output.Stream(formatter=formatter),
))

Any ideas on making this rather common use-case a bit cleaner? (Perhaps a magic kwarg to daiquiri.setup() like fmt="..."?

@jd
Copy link
Member

jd commented Mar 14, 2018

We could probably add a little helper module for common use cases like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants