mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-10 10:47:51 +08:00
docs(elog/Event)
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
6245f0c67e
commit
a84ddcf932
@ -12,8 +12,24 @@ func init() {
|
||||
SetupLogging()
|
||||
}
|
||||
|
||||
// EventLogger extends the StandardLogger interface to allow for log items
|
||||
// containing structured metadata
|
||||
type EventLogger interface {
|
||||
StandardLogger
|
||||
|
||||
// Event merges structured data from the provided inputs into a single
|
||||
// machine-readable log event.
|
||||
//
|
||||
// If the context contains metadata, a copy of this is used as the base
|
||||
// metadata accumulator.
|
||||
//
|
||||
// If one or more loggable objects are provided, these are deep-merged into base blob.
|
||||
//
|
||||
// Next, the event name is added to the blob under the key "event". If
|
||||
// the key "event" already exists, it will be over-written.
|
||||
//
|
||||
// Finally the timestamp and package name are added to the accumulator and
|
||||
// the metadata is logged.
|
||||
Event(ctx context.Context, event string, m ...Loggable)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user