From 7592fcbe604741a8d6044390c09d70c01569e1b3 Mon Sep 17 00:00:00 2001 From: hazimj <42558497+hazimj@users.noreply.github.com> Date: Fri, 25 Oct 2019 11:02:51 +1100 Subject: [PATCH] make TimeFormatUnixMicro var exportable (#189) --- README.md | 2 +- globals.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0e58837..a97bb06 100644 --- a/README.md +++ b/README.md @@ -479,7 +479,7 @@ Some settings can be changed and will by applied to all loggers: * `zerolog.LevelFieldName`: Can be set to customize level field name. * `zerolog.MessageFieldName`: Can be set to customize message field name. * `zerolog.ErrorFieldName`: Can be set to customize `Err` field name. -* `zerolog.TimeFieldFormat`: Can be set to customize `Time` field value formatting. If set with `zerolog.TimeFormatUnix`, `zerolog.TimeFormatUnixMs` or `zerolog.timeFormatUnixMicro`, times are formated as UNIX timestamp. +* `zerolog.TimeFieldFormat`: Can be set to customize `Time` field value formatting. If set with `zerolog.TimeFormatUnix`, `zerolog.TimeFormatUnixMs` or `zerolog.TimeFormatUnixMicro`, times are formated as UNIX timestamp. * `zerolog.DurationFieldUnit`: Can be set to customize the unit for time.Duration type fields added by `Dur` (default: `time.Millisecond`). * `zerolog.DurationFieldInteger`: If set to `true`, `Dur` fields are formatted as integers instead of floats (default: `false`). * `zerolog.ErrorHandler`: Called whenever zerolog fails to write an event on its output. If not set, an error is printed on the stderr. This handler must be thread safe and non-blocking. diff --git a/globals.go b/globals.go index 58fc6fb..f7f87be 100644 --- a/globals.go +++ b/globals.go @@ -15,9 +15,9 @@ const ( // serialized as Unix timestamp integers in milliseconds. TimeFormatUnixMs = "UNIXMS" - // timeFormatUnixMicro defines a time format that makes time fields to be + // TimeFormatUnixMicro defines a time format that makes time fields to be // serialized as Unix timestamp integers in microseconds. - timeFormatUnixMicro = "UNIXMICRO" + TimeFormatUnixMicro = "UNIXMICRO" ) var ( @@ -61,7 +61,7 @@ var ( } // TimeFieldFormat defines the time format of the Time field type. If set to - // TimeFormatUnix, TimeFormatUnixMs or timeFormatUnixMicro, the time is formatted as an UNIX + // TimeFormatUnix, TimeFormatUnixMs or TimeFormatUnixMicro, the time is formatted as an UNIX // timestamp as integer. TimeFieldFormat = time.RFC3339