Documentation ¶
Index ¶
- Constants
- Variables
- func AsLocal(ts int64) string
- func AsUTC(ts int64) string
- func CommandLastError(ctx context.Context, cc connect.Client, cid string) (string, error)
- func Copy(to, from context.Context) context.Context
- func Follow(ctx context.Context, conn connect.Client, r *LogRequest, exactSeverity bool) (<-chan *Entry, <-chan error)
- func GetFirstTSForOPID(ctx context.Context, conn connect.Client, opid string) (int64, error)
- func GetLastTSForOPID(ctx context.Context, conn connect.Client, opid string) (int64, error)
- func SetLogEventToContext(ctx context.Context, ev LogEvent) context.Context
- func SetLoggerToContext(ctx context.Context, ev Logger) context.Context
- type Buffer
- type Cursor
- type Entries
- type Entry
- type LogEvent
- type LogKeys
- type LogRequest
- type Logger
- type Opts
- type Severity
Constants ¶
View Source
const ( F = "F" E = "E" W = "W" I = "I" D = "D" )
View Source
const LogTimeFormat = "2006-01-02T15:04:05.000-0700"
LogTimeFormat is a date-time format to be displayed in the log output
Variables ¶
View Source
var ( DiscardLogger = &discardLoggerImpl{} DiscardEvent = &discardEventImpl{} )
Functions ¶
func CommandLastError ¶
func GetFirstTSForOPID ¶
func GetLastTSForOPID ¶
func SetLogEventToContext ¶
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
func CommandLogCursor ¶
type Entries ¶ added in v1.6.0
type Entries struct { Data []Entry `json:"data"` ShowNode bool `json:"-"` Extr bool `json:"-"` // contains filtered or unexported fields }
func LogGetExactSeverity ¶
func (Entries) MarshalJSON ¶ added in v1.6.0
func (*Entries) SetLocation ¶
type Entry ¶ added in v1.6.0
type Entry struct { ObjID primitive.ObjectID `bson:"-" json:"-"` // to get sense of mgs total ordering while reading logs TS int64 `bson:"ts" json:"ts"` Tns int `bson:"ns" json:"-"` TZone int `bson:"tz" json:"-"` LogKeys `bson:",inline" json:",inline"` Msg string `bson:"msg" json:"msg"` }
func (*Entry) StringNode ¶ added in v1.6.0
type LogEvent ¶
type LogEvent interface { Debug(msg string, args ...any) Info(msg string, args ...any) Warning(msg string, args ...any) Error(msg string, args ...any) Fatal(msg string, args ...any) }
func LogEventFromContext ¶
type LogKeys ¶
type LogKeys struct { Severity Severity `bson:"s" json:"s"` RS string `bson:"rs" json:"rs"` Node string `bson:"node" json:"node"` Event string `bson:"e" json:"e"` ObjName string `bson:"eobj" json:"eobj"` Epoch primitive.Timestamp `bson:"ep,omitempty" json:"ep,omitempty"` OPID string `bson:"opid,omitempty" json:"opid,omitempty"` }
type Logger ¶
type Logger interface { NewEvent(typ, name, opid string, epoch primitive.Timestamp) LogEvent NewDefaultEvent() LogEvent Close() SefBuffer(Buffer) PauseMgo() ResumeMgo() Write(p []byte) (n int, err error) Printf(msg string, args ...any) Debug(event, obj, opid string, epoch primitive.Timestamp, msg string, args ...any) Info(event, obj, opid string, epoch primitive.Timestamp, msg string, args ...any) Warning(event, obj, opid string, epoch primitive.Timestamp, msg string, args ...any) Error(event, obj, opid string, epoch primitive.Timestamp, msg string, args ...any) Fatal(event, obj, opid string, epoch primitive.Timestamp, msg string, args ...any) Output(ctx context.Context, e *Entry) error }
func FromContext ¶
Click to show internal directories.
Click to hide internal directories.