Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HookUpdateTime ¶
Types ¶
type WithTime ¶
type WithTime struct {
// contains filtered or unexported fields
}
Example ¶
buf := bytes.Buffer{}
now := time.Date(2022, time.April, 4, 26, 0, 0, 0, time.UTC)
context := exampleWithTime{
NewWithTime(now),
}
logger := genelog.New(&buf).
WithContext(context).
WithFormatter(json.JSON).
AddHook(HookUpdateTime)
logger.Print("mylog1")
logger.Print("mylog2")
fmt.Println(&buf)
func NewWithTime ¶
func (WithTime) MarshalJSON ¶
func (*WithTime) UnmarshalJSON ¶ added in v1.0.11
Click to show internal directories.
Click to hide internal directories.