luno / jettison Goto Github PK
View Code? Open in Web Editor NEWJettison provides structured logging and errors over gRPC
License: MIT License
Jettison provides structured logging and errors over gRPC
License: MIT License
Hi
The readme suggests that jettison/log provides structured JSON logging, but when I use both
log.Info(ctx, "entering the example function", jettison.WithKeyValueString("key", "value"))
and
log.Error(nil, err, jettison.WithKeyValueString("another_key", "another_value"))
neither prints the error to stdout as JSON. I also can't find configurable options to specify that the output JSON.
Below is an example of the output I receive when running jettison/example:
`I 15:59:02.085 g/l/j/e/serverclient/client.go:39: serverclient: Performing a hop to another server[ctx_key=ctx_value,ctx_key2=ctx_value2,ctx_key3=ctx_value3,hops=2]
I 15:59:02.086 g/l/j/e/serverclient/server.go:30: serverclient: Received a Hop request from a client[ctx_key=ctx_value,ctx_key2=ctx_value2,ctx_key3=ctx_value3]
I 15:59:02.086 g/l/j/e/serverclient/client.go:39: serverclient: Performing a hop to another server[ctx_key=ctx_value,ctx_key2=ctx_value2,ctx_key3=ctx_value3,hops=1]
I 15:59:02.086 g/l/j/e/serverclient/server.go:30: serverclient: Received a Hop request from a client[ctx_key=ctx_value,ctx_key2=ctx_value2,ctx_key3=ctx_value3]
E 15:59:02.086 example/example.go:33: serverclient: error hopping: serverclient: run out of hops[hops=1,hops=0]
example: []
example:
Hey there!
I was going through the jettison
library and noticed a +=
being used to append strings. I thought i would make the minor change and use a strings.Builder
instead that is recommended by the go team.
I ran a benchmark and there is a nominal improvement to the execution time with the strings.Builder
object rather than the +=
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.