GithubHelp home page GithubHelp logo

jettison's People

Contributors

adamhicks avatar bubblyworld avatar corverroos avatar echarrod avatar neilluno avatar obalunenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jettison's Issues

Jettison not logging as JSON

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:

  • github.com/luno/jettison/example/serverclient/server.go:38
  • github.com/luno/jettison/example/examplepb/example.pb.go:153
  • github.com/luno/jettison/interceptors/interceptors.go:48
  • github.com/luno/jettison/example/examplepb/example.pb.go:155
  • google.golang.org/[email protected]/server.go:999
  • google.golang.org/[email protected]/server.go:1279
  • google.golang.org/[email protected]/server.go:717
  • runtime/asm_amd64.s:1374
    example:
  • github.com/luno/jettison/example/serverclient/server.go:33
  • github.com/luno/jettison/example/examplepb/example.pb.go:153
  • github.com/luno/jettison/interceptors/interceptors.go:48
  • github.com/luno/jettison/example/examplepb/example.pb.go:155
  • google.golang.org/[email protected]/server.go:999
  • google.golang.org/[email protected]/server.go:1279
  • google.golang.org/[email protected]/server.go:717
  • runtime/asm_amd64.s:1374`

Replacing '+=' with String Builder to the Jettison `normalise()` to

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 +=

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.