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

Suggestions for SLF4J Debug Rendering #18

Open
neilchaudhuri opened this issue Apr 19, 2018 · 0 comments
Open

Suggestions for SLF4J Debug Rendering #18

neilchaudhuri opened this issue Apr 19, 2018 · 0 comments

Comments

@neilchaudhuri
Copy link

I am using PPrint in a situation where we have to be very careful what we log, how we log, and at which levels. As a result, in most cases I do something like this:

logger.debug("Value is {}", pprint.apply(myCaseClass))

The problem is that in terminals that can't read Fansi, I get stuff output like this because of toString (which calls render):

case class Foo(a: Int, b: String)
pprint.apply(Foo(5, "fdf"))
res0: fansi.Str = �[33mFoo�[39m(�[32m5�[39m, �[32m"fdf"�[39m)

And it shows up that way in Splunk.

Is there any guidance or, dare I say it, "best practices" for how best to integrate PPrint with SLF4J so that the output is as rich and clear as possible on both developer environments and logging machinery in higher environments?

Thanks.

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

No branches or pull requests

1 participant