[VOL-1386] This commit add "dep" as the package management tool
for voltha-go.
Change-Id: I52bc4911dd00a441756ec7c30f46d45091f3f90e
diff --git a/vendor/github.com/rs/zerolog/globals.go b/vendor/github.com/rs/zerolog/globals.go
new file mode 100644
index 0000000..1c66904
--- /dev/null
+++ b/vendor/github.com/rs/zerolog/globals.go
@@ -0,0 +1,76 @@
+package zerolog
+
+import "time"
+import "sync/atomic"
+
+var (
+ // TimestampFieldName is the field name used for the timestamp field.
+ TimestampFieldName = "time"
+
+ // LevelFieldName is the field name used for the level field.
+ LevelFieldName = "level"
+
+ // MessageFieldName is the field name used for the message field.
+ MessageFieldName = "message"
+
+ // ErrorFieldName is the field name used for error fields.
+ ErrorFieldName = "error"
+
+ // CallerFieldName is the field name used for caller field.
+ CallerFieldName = "caller"
+
+ // CallerSkipFrameCount is the number of stack frames to skip to find the caller.
+ CallerSkipFrameCount = 2
+
+ // TimeFieldFormat defines the time format of the Time field type.
+ // If set to an empty string, the time is formatted as an UNIX timestamp
+ // as integer.
+ TimeFieldFormat = time.RFC3339
+
+ // TimestampFunc defines the function called to generate a timestamp.
+ TimestampFunc = time.Now
+
+ // DurationFieldUnit defines the unit for time.Duration type fields added
+ // using the Dur method.
+ DurationFieldUnit = time.Millisecond
+
+ // DurationFieldInteger renders Dur fields as integer instead of float if
+ // set to true.
+ DurationFieldInteger = false
+
+ // ErrorHandler is 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.
+ ErrorHandler func(err error)
+)
+
+var (
+ gLevel = new(uint32)
+ disableSampling = new(uint32)
+)
+
+// SetGlobalLevel sets the global override for log level. If this
+// values is raised, all Loggers will use at least this value.
+//
+// To globally disable logs, set GlobalLevel to Disabled.
+func SetGlobalLevel(l Level) {
+ atomic.StoreUint32(gLevel, uint32(l))
+}
+
+// GlobalLevel returns the current global log level
+func GlobalLevel() Level {
+ return Level(atomic.LoadUint32(gLevel))
+}
+
+// DisableSampling will disable sampling in all Loggers if true.
+func DisableSampling(v bool) {
+ var i uint32
+ if v {
+ i = 1
+ }
+ atomic.StoreUint32(disableSampling, i)
+}
+
+func samplingDisabled() bool {
+ return atomic.LoadUint32(disableSampling) == 1
+}