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

Usage examples #9

Open
ash211 opened this issue Jun 8, 2017 · 1 comment
Open

Usage examples #9

ash211 opened this issue Jun 8, 2017 · 1 comment

Comments

@ash211
Copy link
Contributor

ash211 commented Jun 8, 2017

How should these annotations be used? Do they work only for JAX-RS endpoints, or are these also the annotations that should be placed for log4j calls?

Please provide usage examples in the README for how to use this library.

@TheBeruriahIncident
Copy link

Related, there's rumor that usage example given is not the normal way to use this. It shows:

Preconditions.checkArgument(uname.size() > MAX_LEN, "{} username longer than max {}", 
        UnsafeArg.of("uname", uname), SafeArg.of("max", MAX_LEN));

but I hear that:

Preconditions.checkArgument(uname.size() > MAX_LEN, "Username longer than max length", 
        UnsafeArg.of("username", uname), SafeArg.of("max length", MAX_LEN));

is more normal. I.e. the message stands alone and doesn't use args.

Is that true? If so, we can probably tweak the example.

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

2 participants