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

Binary format support #37

Merged
merged 26 commits into from
Mar 28, 2018
Merged

Binary format support #37

merged 26 commits into from
Mar 28, 2018

Conversation

toravir
Copy link
Contributor

@toravir toravir commented Feb 10, 2018

Submitting the PR for #21 with two minor things in the todo items:

  1. Changes to documentation (README.md)
    Because after code review, will write the docs.

  2. When doing reflection, skip using JSON and write a binary based encoder
    Writing an equivalent of json.Marshal() would take more time and careful testing.

@toravir
Copy link
Contributor Author

toravir commented Feb 10, 2018

Will resolve conflicts in a day or two - need to understand how the hooks work.

@rs
Copy link
Owner

rs commented Feb 11, 2018

All the "if binary then cbor else json" everywhere is to avoid using an interface and leave a chance for the compiler to inline those calls? It make the code hard to maintain, we should find a better solution.

@toravir
Copy link
Contributor Author

toravir commented Feb 11, 2018

I went back and forth trying to decide about it - if we decide to use the interface, go will have to alloc memory for the arguments - since it is not known where the interface will point to.

I kept the signatures of json and cbor apis very similar so that if we want to do interface, can be done.

I didn't find any other way - but i will post of go forum asking for alternatives.

@rs
Copy link
Owner

rs commented Feb 11, 2018

Here is another approach: a6bc163

The runtime cost is lighter than condition and the code is simpler. The downside is that you need to use build tag to enable binary (e.g.: go build -tag zerolog_binary).

@toravir
Copy link
Contributor Author

toravir commented Feb 11, 2018 via email

@rs
Copy link
Owner

rs commented Feb 11, 2018

Most people would have a separate build for production. So the tag approach would work.

@toravir
Copy link
Contributor Author

toravir commented Feb 11, 2018 via email

@toravir
Copy link
Contributor Author

toravir commented Feb 17, 2018

one final thing i am still debugging - allocs/op for ArrayObj is non-zero ...

@toravir
Copy link
Contributor Author

toravir commented Feb 18, 2018

@rs - the code is ready for merge - fixed the last issue. Here's the benchmark results - highlighting the difference. https://docs.google.com/spreadsheets/d/1SDFzgPKkkF1xckoNh-5RlCH1XRvgrKX_r-co3u_Bupo/edit?usp=sharing

There are two sheets:

  1. JSON Logging (base code Vs with these changes)
  2. In my forked branch - JSON Logging Vs Binary Logging

Three things i will work on next:

  1. Documentation
  2. Replace the call to json.Marshal() in CBOR for Objects not implementing the marshaller Interface
  3. Decoder tool that can take a file containing binary logs and print out json (text)

Thx

array.go Outdated
@@ -16,7 +14,7 @@ var arrayPool = &sync.Pool{
}

type Array struct {
buf []byte
buf []byte
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does gofmt agree with this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops.. will run gofmt and update the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

hook_test.go Outdated
@@ -1,3 +1,5 @@
// +build !enable_binary_log
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooks can't work with binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hooks does work. these tests compare the output with a json string. So duplicated few of the testcases into binary_tests.go and there i convert binary to json and compare with the output.

other thought i had was to clone each _test.go into a _binary_test.go and do the exact same tests.. but then i decided it will be too many _test.go files - so i went with one binary_tests.go with all binary related tests (hooks, ctxt..)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about wrapping the wanted output into a noop method in json mode that convert the json into cbor in binary mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

ctx_test.go Outdated
@@ -1,3 +1,5 @@
// +build !enable_binary_log
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment for hook_test.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done - enabled this test for binary as well.

return append(dst, '{')
}

func AppendEndMarker(dst []byte, terminal bool) []byte {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you extract the "terminal = true" in it's own AppendLineBreak instead of adding a branch to all end markers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. will introduce appendLineBreak..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


func AppendObjectData(dst []byte, o []byte) []byte {
if o[0] == '{' {
o[0] = ','
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment explaining why you have to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

log.go Outdated

//DecodeIfBinaryToString - converts a binary formatted log msg to a
//JSON formatted String Log message - suitable for printing to Console/Syslog etc
func DecodeIfBinaryToString(in []byte) string {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not export those methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think zerolog needs to provide decode method apis. Since CBOR package is internal to zerolog, i thought zerolog can provide one.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we provide a decoder, to be useful it should take a reader and write into a struct instead converting to json. It would be thus better to expose the cbor package.

I don’t think it is the role of a log lib to do that. If there is not cbor lib available to decode cbor, let’s expose the cbor lib as a separate project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. no longer expose this api.

syslog.go Outdated
@@ -26,11 +28,13 @@ func SyslogLevelWriter(w SyslogWriter) LevelWriter {
}

func (sw syslogWriter) Write(p []byte) (n int, err error) {
p = DecodeIfBinaryToBytes(p, true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it is relevant to do that. What is the point to enable binary logging if the writer silently converts it back to JSON?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and console are writing to text destinations (syslog/console), outputing binary is not good - so i thought decoding is needed. in case of writing to these text destinations, we cannot delay the decoding of the binary to json. when writing to file or stream etc we can run a decoder.

An alternative for this is users run another process that takes these logs and decodes it and prints to console/syslog...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it for console. For syslog we should not implement it in binary mode as it does not make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excluded syslog and hlog from binary support.

json_encoder.go Outdated
@@ -0,0 +1,184 @@
// +build !enable_binary_log

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have named the two encoders encoder_json.go and encoder_cbor.go so they stay grouped together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can rename the files to encoder_json, encoder_cbor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@rs
Copy link
Owner

rs commented Feb 19, 2018

Do you know why some of the JSON parts are so much worse perf-wize after the change?

@toravir
Copy link
Contributor Author

toravir commented Feb 19, 2018

will investigate a bit more on the reason for cpu increase

@toravir
Copy link
Contributor Author

toravir commented Feb 27, 2018

@rs - i've updated the same google doc with the new performance numbers. There is a little bit of variation of the ns/op numbers between each run (i've noticed variation of +/- 40ns on my machine) for the same test in the same codebase. For the one case "LogArrayObject" case the difference is about 200ns - i did a bunch of trials with various code combinations and found that the overhead of function calls adds up to it and ArrayObject lots of such function calls (as compared to other benchmarks). These functions are not leaf functions, so they are not getting inlined.

The variation in calculation (+/- 40ns) explains the cases where the cpu usage is lower in spite of the extra function call introduced by this code change.

To provide more details - a single call to (Array )Object() involves:
(Array
)Object():
-> Create event (call to Dict())
-> MarshalZerologObject()
-> Str() X 2
-> appendString() X 2
-> json.AppendKey() X 2
-> json.AppendString() X 2
-> Int()
-> appendInt()
-> json.AppendKey()
-> json.AppendInt()
-> appendEndMarker()
-> json.AppendEndMarker()
-> appendArrayDelim()
-> json.AppendArrayDelim()

I am going to move most of the single line functions from json Package to encoder_json.go (same for cbor).

@toravir
Copy link
Contributor Author

toravir commented Feb 27, 2018

Moved some of the simple functions from json pkg to encoder_json - helped cut the cpu usage for json encoding.

log := zerolog.New(w)
log.Print("test")

w.Close()
fmt.Println(cbor.DecodeIfBinaryToString(buf.Bytes()))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug left-over?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have three options with tests:

  1. Disable them for binary (since the tests compare the output with text output).
  2. Decode if binary and let the comparison with text output continue..
  3. Go with Option 1 - but create another file which does the same test for binary

I chose 2nd option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cleaner approach occurred to me:
Since examples show up in documentation, i made it just text - so doc looks clean
Same examples, i made sure that there were tests that tested both ascii and binary - so i split diode_test.go to diode_example_test.go (text only) / diode_test.go (text and binary).

hlog/hlog.go Outdated
@@ -1,3 +1,5 @@
// +build !enable_binary_log
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a judgement call that http logger will not want binary encoding - just like how syslog and binary log doesn't go together. Do you think otherwise ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP handlers are just tools to add context to the logs. The format of the output does not matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad. i didn't read hlog in detail... Will read thru and make necessary changes in a few days..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabled hlog_test.go for binary test too. hlog_example_test.go - i left it just text.

@rs
Copy link
Owner

rs commented Mar 9, 2018

Bench with current master in JSON mode:

name                               old time/op    new time/op    delta
LogEmpty-8                           12.5ns ± 6%    16.4ns ±11%  +30.61%  (p=0.000 n=9+10)
Disabled-8                           2.38ns ± 8%    2.89ns ±12%  +21.18%  (p=0.000 n=10+10)
Info-8                               39.5ns ± 5%    53.7ns ± 8%  +35.92%  (p=0.000 n=10+10)
ContextFields-8                      43.1ns ±11%    53.9ns ± 6%  +25.00%  (p=0.000 n=10+10)
ContextAppend-8                      16.8ns ±14%    19.5ns ± 3%  +16.12%  (p=0.000 n=10+10)
LogFields-8                           223ns ± 9%     223ns ±10%     ~     (p=0.795 n=9+10)
LogArrayObject-8                      473ns ± 6%     567ns ± 2%  +19.71%  (p=0.000 n=9+9)
LogFieldType/Err-8                   40.1ns ± 2%    40.0ns ± 5%     ~     (p=0.572 n=8+10)
LogFieldType/Time-8                   155ns ± 3%     133ns ± 5%  -14.24%  (p=0.000 n=10+10)
LogFieldType/Times-8                 1.11µs ± 5%    0.92µs ± 3%  -17.24%  (p=0.000 n=10+9)
LogFieldType/Dur-8                   57.4ns ± 6%    52.8ns ± 3%   -8.00%  (p=0.000 n=8+8)
LogFieldType/Ints-8                  66.0ns ± 7%    60.8ns ± 8%   -7.81%  (p=0.001 n=9+9)
LogFieldType/Bools-8                 43.5ns ± 8%    43.5ns ± 5%     ~     (p=0.926 n=10+10)
LogFieldType/Interface-8              208ns ± 8%     203ns ±15%     ~     (p=0.098 n=8+9)
LogFieldType/Interface(Object)-8      103ns ± 7%     100ns ± 3%   -3.36%  (p=0.024 n=10+10)
LogFieldType/Object-8                 103ns ± 8%      97ns ± 4%   -6.03%  (p=0.002 n=10+9)
LogFieldType/Bool-8                  29.3ns ± 5%    37.2ns ± 4%  +27.05%  (p=0.000 n=9+8)
LogFieldType/Floats-8                 202ns ± 9%     207ns ± 2%   +2.53%  (p=0.020 n=9+7)
LogFieldType/Durs-8                   363ns ± 5%     362ns ± 7%     ~     (p=0.713 n=9+9)
LogFieldType/Interfaces-8             839ns ± 4%     843ns ± 8%     ~     (p=0.920 n=10+9)
LogFieldType/Int-8                   36.1ns ± 7%    38.8ns ±15%   +7.59%  (p=0.041 n=10+10)
LogFieldType/Str-8                   33.1ns ± 6%    37.9ns ± 3%  +14.64%  (p=0.000 n=10+9)
LogFieldType/Strs-8                  63.2ns ±11%    63.3ns ±10%     ~     (p=0.781 n=10+10)
LogFieldType/Errs-8                  52.5ns ±12%    52.8ns ± 2%     ~     (p=0.181 n=10+7)
LogFieldType/Interface(Objects)-8     905ns ± 5%     931ns ±15%     ~     (p=0.239 n=10+10)
LogFieldType/Float-8                 51.0ns ±11%    51.3ns ± 1%     ~     (p=0.433 n=10+9)
ContextFieldType/Bools-8              165ns ±17%     171ns ±17%     ~     (p=0.492 n=10+10)
ContextFieldType/Int-8                148ns ±17%     163ns ±25%     ~     (p=0.072 n=10+10)
ContextFieldType/Timestamp-8          184ns ±14%     183ns ±11%     ~     (p=0.985 n=10+10)

name                               old alloc/op   new alloc/op   delta
LogEmpty-8                            0.00B          0.00B          ~     (all equal)
Disabled-8                            0.00B          0.00B          ~     (all equal)
Info-8                                0.00B          0.00B          ~     (all equal)
ContextFields-8                       0.00B          0.00B          ~     (all equal)
ContextAppend-8                       0.00B          0.00B          ~     (all equal)
LogFields-8                           0.00B          0.00B          ~     (all equal)
LogArrayObject-8                      0.00B          0.00B          ~     (all equal)
LogFieldType/Err-8                    0.00B          0.00B          ~     (all equal)
LogFieldType/Time-8                   0.00B          0.00B          ~     (all equal)
LogFieldType/Times-8                  0.00B          0.00B          ~     (all equal)
LogFieldType/Dur-8                    0.00B          0.00B          ~     (all equal)
LogFieldType/Ints-8                   0.00B          0.00B          ~     (all equal)
LogFieldType/Bools-8                  0.00B          0.00B          ~     (all equal)
LogFieldType/Interface-8               224B ± 0%      224B ± 0%     ~     (all equal)
LogFieldType/Interface(Object)-8      48.0B ± 0%     48.0B ± 0%     ~     (all equal)
LogFieldType/Object-8                 48.0B ± 0%     48.0B ± 0%     ~     (all equal)
LogFieldType/Bool-8                   0.00B          0.00B          ~     (all equal)
LogFieldType/Floats-8                 0.00B          0.00B          ~     (all equal)
LogFieldType/Durs-8                   0.00B          0.00B          ~     (all equal)
LogFieldType/Interfaces-8              640B ± 0%      640B ± 0%     ~     (all equal)
LogFieldType/Int-8                    0.00B          0.00B          ~     (all equal)
LogFieldType/Str-8                    0.00B          0.00B          ~     (all equal)
LogFieldType/Strs-8                   0.00B          0.00B          ~     (all equal)
LogFieldType/Errs-8                   0.00B          0.00B          ~     (all equal)
LogFieldType/Interface(Objects)-8      640B ± 0%      640B ± 0%     ~     (all equal)
LogFieldType/Float-8                  0.00B          0.00B          ~     (all equal)
ContextFieldType/Bools-8               512B ± 0%      512B ± 0%     ~     (all equal)
ContextFieldType/Int-8                 512B ± 0%      512B ± 0%     ~     (all equal)
ContextFieldType/Timestamp-8           528B ± 0%      528B ± 0%     ~     (all equal)

name                               old allocs/op  new allocs/op  delta
LogEmpty-8                             0.00           0.00          ~     (all equal)
Disabled-8                             0.00           0.00          ~     (all equal)
Info-8                                 0.00           0.00          ~     (all equal)
ContextFields-8                        0.00           0.00          ~     (all equal)
ContextAppend-8                        0.00           0.00          ~     (all equal)
LogFields-8                            0.00           0.00          ~     (all equal)
LogArrayObject-8                       0.00           0.00          ~     (all equal)
LogFieldType/Err-8                     0.00           0.00          ~     (all equal)
LogFieldType/Time-8                    0.00           0.00          ~     (all equal)
LogFieldType/Times-8                   0.00           0.00          ~     (all equal)
LogFieldType/Dur-8                     0.00           0.00          ~     (all equal)
LogFieldType/Ints-8                    0.00           0.00          ~     (all equal)
LogFieldType/Bools-8                   0.00           0.00          ~     (all equal)
LogFieldType/Interface-8               2.00 ± 0%      2.00 ± 0%     ~     (all equal)
LogFieldType/Interface(Object)-8       1.00 ± 0%      1.00 ± 0%     ~     (all equal)
LogFieldType/Object-8                  1.00 ± 0%      1.00 ± 0%     ~     (all equal)
LogFieldType/Bool-8                    0.00           0.00          ~     (all equal)
LogFieldType/Floats-8                  0.00           0.00          ~     (all equal)
LogFieldType/Durs-8                    0.00           0.00          ~     (all equal)
LogFieldType/Interfaces-8              4.00 ± 0%      4.00 ± 0%     ~     (all equal)
LogFieldType/Int-8                     0.00           0.00          ~     (all equal)
LogFieldType/Str-8                     0.00           0.00          ~     (all equal)
LogFieldType/Strs-8                    0.00           0.00          ~     (all equal)
LogFieldType/Errs-8                    0.00           0.00          ~     (all equal)
LogFieldType/Interface(Objects)-8      4.00 ± 0%      4.00 ± 0%     ~     (all equal)
LogFieldType/Float-8                   0.00           0.00          ~     (all equal)
ContextFieldType/Bools-8               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
ContextFieldType/Int-8                 1.00 ± 0%      1.00 ± 0%     ~     (all equal)
ContextFieldType/Timestamp-8           2.00 ± 0%      2.00 ± 0%     ~     (all equal)```

We still have some significant changes in surprising places.

@toravir
Copy link
Contributor Author

toravir commented Mar 10, 2018

i am struggling a bit to nail down the cause of the cpu increase. For instance Bools is the same where as Bool is very different. Also i ran it on a linux machine and got a slightly different result:

LogEmpty-4                               28.8ns ±12%    28.9ns ±12%     ~     (p=0.735 n=11+11)
Disabled-4                               4.96ns ± 2%    4.99ns ± 2%     ~     (p=0.357 n=10+11)
Info-4                                    100ns ± 6%     108ns ± 7%   +8.71%  (p=0.000 n=10+11)
ContextFields-4                           111ns ± 3%     118ns ± 7%   +6.14%  (p=0.000 n=8+11)
ContextAppend-4                          55.6ns ± 0%    58.4ns ± 0%   +4.94%  (p=0.000 n=10+10)
LogFields-4                               371ns ± 2%     370ns ± 1%     ~     (p=0.381 n=10+10)
LogArrayObject-4                         1.09µs ± 1%    1.28µs ± 2%  +17.75%  (p=0.000 n=10+11)
LogFieldType/Floats-4                     370ns ± 6%     381ns ± 2%   +3.00%  (p=0.024 n=10+10)
LogFieldType/Str-4                       55.5ns ± 8%    63.9ns ±10%  +15.26%  (p=0.000 n=9+11)
LogFieldType/Strs-4                      97.6ns ±12%   102.0ns ± 8%   +4.57%  (p=0.027 n=11+11)
LogFieldType/Time-4                       218ns ± 6%     223ns ± 7%     ~     (p=0.119 n=11+11)
LogFieldType/Durs-4                       647ns ± 3%     646ns ± 1%     ~     (p=0.876 n=11+10)
....
....

I am trying a eliminate parts of the code and trying to figure out what is causing this.. if you do have some inputs, would be appreciated. I've read most of the blogs/write ups about pprof etc - still not able to get narrow it quickly..

@rs
Copy link
Owner

rs commented Mar 12, 2018

I'm not sure to understand why either.

Copy link
Owner

@rs rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm considering merging once those few cosmetic changes are applied. The perf delta is minimal and not always reproducible. I will consider it as noise.

context.go Outdated
c.l.context = json.AppendError(json.AppendKey(c.l.context, ErrorFieldName), err)
}
return c
return c.AnErr(ErrorFieldName, err)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err is used more than AnErr. I would prefer not to add a func call here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

encoder_cbor.go Outdated

func appendObjectData(dst []byte, src []byte) []byte {
//we keep the map begin Character in context - we
//don't need to copy that - so skip first char
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add space after // and use cap/period for comments please?

case time.Duration:
dst = json.AppendDuration(dst, val, DurationFieldUnit, DurationFieldInteger)
dst = appendDuration(dst, val, DurationFieldUnit, DurationFieldInteger)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge last change that append pointers support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,74 @@
Reference:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use .md instead of .MD.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@toravir
Copy link
Contributor Author

toravir commented Mar 27, 2018

@rs - builds on travis hits a spurious error - which i am not able to recreate on my end - https://travis-ci.org/rs/zerolog/builds/358665413 i tried to on my mac, linux and a docker with go1.10 and ran 50+ times, still cannot reproduce it.. not sure what would be causing this. Sometimes the same test passes on travis (like https://travis-ci.org/rs/zerolog/builds/358670909).. just letting you know..

@rs
Copy link
Owner

rs commented Mar 28, 2018

Awesome work @toravir, thanks a lot!

@rs
Copy link
Owner

rs commented Mar 28, 2018

One last request before change. Instead of enable_binary_log can we use binary_log or zerolog_binary instead. Flags are about enabling, so I feel like the enable prefix is redundant.

@toravir
Copy link
Contributor Author

toravir commented Mar 28, 2018

Yes @rs 'binary_log' is clear, simple and neat tag name. Pushed the changes. appreciate all your feedback.

.travis.yml Outdated
@@ -9,4 +9,5 @@ matrix:
allow_failures:
- go: "master"
script:
go test -v -race -cpu=1,2,4 -bench . -benchmem ./...
- go test -v -race -cpu=1,2,4 -bench . -benchmem ./...
- go test -v -tags enable_binary_log -race -cpu=1,2,4 -bench . -benchmem ./...
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops yeah. fixed it.

@rs rs merged commit ddfae1b into rs:master Mar 28, 2018
@toravir toravir deleted the binary branch April 27, 2018 13:11
@rs
Copy link
Owner

rs commented May 10, 2018

@toravir FYI: ea1184b

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

Successfully merging this pull request may close these issues.

2 participants