const DefaultLineEnding … const OmitKey … type LevelEncoder … // LowercaseLevelEncoder serializes a Level to a lowercase string. For example, // InfoLevel is serialized to "info". func LowercaseLevelEncoder(l Level, enc PrimitiveArrayEncoder) { … } // LowercaseColorLevelEncoder serializes a Level to a lowercase string and adds coloring. // For example, InfoLevel is serialized to "info" and colored blue. func LowercaseColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) { … } // CapitalLevelEncoder serializes a Level to an all-caps string. For example, // InfoLevel is serialized to "INFO". func CapitalLevelEncoder(l Level, enc PrimitiveArrayEncoder) { … } // CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color. // For example, InfoLevel is serialized to "INFO" and colored blue. func CapitalColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) { … } // UnmarshalText unmarshals text to a LevelEncoder. "capital" is unmarshaled to // CapitalLevelEncoder, "coloredCapital" is unmarshaled to CapitalColorLevelEncoder, // "colored" is unmarshaled to LowercaseColorLevelEncoder, and anything else // is unmarshaled to LowercaseLevelEncoder. func (e *LevelEncoder) UnmarshalText(text []byte) error { … } type TimeEncoder … // EpochTimeEncoder serializes a time.Time to a floating-point number of seconds // since the Unix epoch. func EpochTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { … } // EpochMillisTimeEncoder serializes a time.Time to a floating-point number of // milliseconds since the Unix epoch. func EpochMillisTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { … } // EpochNanosTimeEncoder serializes a time.Time to an integer number of // nanoseconds since the Unix epoch. func EpochNanosTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { … } func encodeTimeLayout(t time.Time, layout string, enc PrimitiveArrayEncoder) { … } // ISO8601TimeEncoder serializes a time.Time to an ISO8601-formatted string // with millisecond precision. // // If enc supports AppendTimeLayout(t time.Time,layout string), it's used // instead of appending a pre-formatted string value. func ISO8601TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { … } // RFC3339TimeEncoder serializes a time.Time to an RFC3339-formatted string. // // If enc supports AppendTimeLayout(t time.Time,layout string), it's used // instead of appending a pre-formatted string value. func RFC3339TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { … } // RFC3339NanoTimeEncoder serializes a time.Time to an RFC3339-formatted string // with nanosecond precision. // // If enc supports AppendTimeLayout(t time.Time,layout string), it's used // instead of appending a pre-formatted string value. func RFC3339NanoTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { … } // TimeEncoderOfLayout returns TimeEncoder which serializes a time.Time using // given layout. func TimeEncoderOfLayout(layout string) TimeEncoder { … } // UnmarshalText unmarshals text to a TimeEncoder. // "rfc3339nano" and "RFC3339Nano" are unmarshaled to RFC3339NanoTimeEncoder. // "rfc3339" and "RFC3339" are unmarshaled to RFC3339TimeEncoder. // "iso8601" and "ISO8601" are unmarshaled to ISO8601TimeEncoder. // "millis" is unmarshaled to EpochMillisTimeEncoder. // "nanos" is unmarshaled to EpochNanosEncoder. // Anything else is unmarshaled to EpochTimeEncoder. func (e *TimeEncoder) UnmarshalText(text []byte) error { … } // UnmarshalYAML unmarshals YAML to a TimeEncoder. // If value is an object with a "layout" field, it will be unmarshaled to TimeEncoder with given layout. // // timeEncoder: // layout: 06/01/02 03:04pm // // If value is string, it uses UnmarshalText. // // timeEncoder: iso8601 func (e *TimeEncoder) UnmarshalYAML(unmarshal func(interface{ … } // UnmarshalJSON unmarshals JSON to a TimeEncoder as same way UnmarshalYAML does. func (e *TimeEncoder) UnmarshalJSON(data []byte) error { … } type DurationEncoder … // SecondsDurationEncoder serializes a time.Duration to a floating-point number of seconds elapsed. func SecondsDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { … } // NanosDurationEncoder serializes a time.Duration to an integer number of // nanoseconds elapsed. func NanosDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { … } // MillisDurationEncoder serializes a time.Duration to an integer number of // milliseconds elapsed. func MillisDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { … } // StringDurationEncoder serializes a time.Duration using its built-in String // method. func StringDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { … } // UnmarshalText unmarshals text to a DurationEncoder. "string" is unmarshaled // to StringDurationEncoder, and anything else is unmarshaled to // NanosDurationEncoder. func (e *DurationEncoder) UnmarshalText(text []byte) error { … } type CallerEncoder … // FullCallerEncoder serializes a caller in /full/path/to/package/file:line // format. func FullCallerEncoder(caller EntryCaller, enc PrimitiveArrayEncoder) { … } // ShortCallerEncoder serializes a caller in package/file:line format, trimming // all but the final directory from the full path. func ShortCallerEncoder(caller EntryCaller, enc PrimitiveArrayEncoder) { … } // UnmarshalText unmarshals text to a CallerEncoder. "full" is unmarshaled to // FullCallerEncoder and anything else is unmarshaled to ShortCallerEncoder. func (e *CallerEncoder) UnmarshalText(text []byte) error { … } type NameEncoder … // FullNameEncoder serializes the logger name as-is. func FullNameEncoder(loggerName string, enc PrimitiveArrayEncoder) { … } // UnmarshalText unmarshals text to a NameEncoder. Currently, everything is // unmarshaled to FullNameEncoder. func (e *NameEncoder) UnmarshalText(text []byte) error { … } type EncoderConfig … type ObjectEncoder … type ArrayEncoder … type PrimitiveArrayEncoder … type Encoder …