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

Initial support for arrays #239

Merged
merged 6 commits into from
Jan 12, 2017
Merged

Initial support for arrays #239

merged 6 commits into from
Jan 12, 2017

Commits on Jan 12, 2017

  1. Add an internal multierror package

    We'll need a multierror implementation in both zap and zapcore to
    support arrays. Clean up the existing implementation a bit and promote
    it to its own internal package.
    Akshay Shah committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    73222c4 View commit details
    Browse the repository at this point in the history
  2. Add support for logging arrays

    Add basic support for logging arrays. To limit the scope of this commit,
    it introduces only arrays of ObjectMarshalers, arrays of arrays, and
    arrays of bools. It should, however, clarify how I intend to support
    arrays of other concrete types.
    
    Of note, I opted not to have `zap.Bools` return a `Field`. Instead, it
    returns a `zapcore.ArrayMarshaler`. This lets us build arrays of
    heterogenous arrays. For most users, this will be papered over by the
    upcoming `zap.Any(key string, val interface{}) zapcore.Field` function,
    which will basically be a huge type switch.
    Akshay Shah committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    8ffe8c8 View commit details
    Browse the repository at this point in the history
  3. Simpler struct literals in tests

    Akshay Shah committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    921f06e View commit details
    Browse the repository at this point in the history
  4. Update some comments

    Akshay Shah committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    b1ea0b9 View commit details
    Browse the repository at this point in the history
  5. Add some simple benchmarks

    ```
    BenchmarkBoolsArrayMarshaler-4   	 1000000	      1028 ns/op	 1088 B/op	       3 allocs/op
    BenchmarkBoolsReflect-4          	  500000	      3293 ns/op	 2280 B/op	       8 allocs/op
    ```
    Akshay Shah committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    8c010d8 View commit details
    Browse the repository at this point in the history
  6. Cleanups from CR

    Akshay Shah committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    4b45c11 View commit details
    Browse the repository at this point in the history