Documentation ¶
Index ¶
- Constants
- func GetLogLevelContext(level Level) context.Context
- func IsBasedOn(t, lookFor TestingLogger) bool
- type BareOutput
- type BuildConfig
- type CallerFieldMode
- type Config
- type CopyLoggerParams
- type DurationReportFunc
- type DynFieldFunc
- type DynFieldMap
- type EmbeddedLogger
- type EmbeddedLoggerBuilder
- type EmbeddedLoggerMock
- func (mmCopy *EmbeddedLoggerMock) Copy() (e1 EmbeddedLoggerBuilder)
- func (mmCopy *EmbeddedLoggerMock) CopyAfterCounter() uint64
- func (mmCopy *EmbeddedLoggerMock) CopyBeforeCounter() uint64
- func (mmEmbeddedFlush *EmbeddedLoggerMock) EmbeddedFlush(msg string)
- func (mmEmbeddedFlush *EmbeddedLoggerMock) EmbeddedFlushAfterCounter() uint64
- func (mmEmbeddedFlush *EmbeddedLoggerMock) EmbeddedFlushBeforeCounter() uint64
- func (mmFieldsOf *EmbeddedLoggerMock) FieldsOf(v1 reflect.Value) (l1 logfmt.LogObjectMarshaller)
- func (mmFieldsOf *EmbeddedLoggerMock) FieldsOfAfterCounter() uint64
- func (mmFieldsOf *EmbeddedLoggerMock) FieldsOfBeforeCounter() uint64
- func (mmIs *EmbeddedLoggerMock) Is(l1 Level) (b1 bool)
- func (mmIs *EmbeddedLoggerMock) IsAfterCounter() uint64
- func (mmIs *EmbeddedLoggerMock) IsBeforeCounter() uint64
- func (m *EmbeddedLoggerMock) MinimockCopyDone() bool
- func (m *EmbeddedLoggerMock) MinimockCopyInspect()
- func (m *EmbeddedLoggerMock) MinimockEmbeddedFlushDone() bool
- func (m *EmbeddedLoggerMock) MinimockEmbeddedFlushInspect()
- func (m *EmbeddedLoggerMock) MinimockFieldsOfDone() bool
- func (m *EmbeddedLoggerMock) MinimockFieldsOfInspect()
- func (m *EmbeddedLoggerMock) MinimockFinish()
- func (m *EmbeddedLoggerMock) MinimockIsDone() bool
- func (m *EmbeddedLoggerMock) MinimockIsInspect()
- func (m *EmbeddedLoggerMock) MinimockNewEventDone() bool
- func (m *EmbeddedLoggerMock) MinimockNewEventFmtDone() bool
- func (m *EmbeddedLoggerMock) MinimockNewEventFmtInspect()
- func (m *EmbeddedLoggerMock) MinimockNewEventInspect()
- func (m *EmbeddedLoggerMock) MinimockNewEventStructDone() bool
- func (m *EmbeddedLoggerMock) MinimockNewEventStructInspect()
- func (m *EmbeddedLoggerMock) MinimockWait(timeout mm_time.Duration)
- func (mmNewEvent *EmbeddedLoggerMock) NewEvent(level Level) (f1 func(args []interface{}))
- func (mmNewEvent *EmbeddedLoggerMock) NewEventAfterCounter() uint64
- func (mmNewEvent *EmbeddedLoggerMock) NewEventBeforeCounter() uint64
- func (mmNewEventFmt *EmbeddedLoggerMock) NewEventFmt(level Level) (f1 func(fmt string, args []interface{}))
- func (mmNewEventFmt *EmbeddedLoggerMock) NewEventFmtAfterCounter() uint64
- func (mmNewEventFmt *EmbeddedLoggerMock) NewEventFmtBeforeCounter() uint64
- func (mmNewEventStruct *EmbeddedLoggerMock) NewEventStruct(level Level) (f1 func(interface{}, []logfmt.LogFieldMarshaller))
- func (mmNewEventStruct *EmbeddedLoggerMock) NewEventStructAfterCounter() uint64
- func (mmNewEventStruct *EmbeddedLoggerMock) NewEventStructBeforeCounter() uint64
- type EmbeddedLoggerMockCopyExpectation
- type EmbeddedLoggerMockCopyResults
- type EmbeddedLoggerMockEmbeddedFlushExpectation
- type EmbeddedLoggerMockEmbeddedFlushParams
- type EmbeddedLoggerMockFieldsOfExpectation
- type EmbeddedLoggerMockFieldsOfParams
- type EmbeddedLoggerMockFieldsOfResults
- type EmbeddedLoggerMockIsExpectation
- type EmbeddedLoggerMockIsParams
- type EmbeddedLoggerMockIsResults
- type EmbeddedLoggerMockNewEventExpectation
- type EmbeddedLoggerMockNewEventFmtExpectation
- type EmbeddedLoggerMockNewEventFmtParams
- type EmbeddedLoggerMockNewEventFmtResults
- type EmbeddedLoggerMockNewEventParams
- type EmbeddedLoggerMockNewEventResults
- type EmbeddedLoggerMockNewEventStructExpectation
- type EmbeddedLoggerMockNewEventStructParams
- type EmbeddedLoggerMockNewEventStructResults
- type EmbeddedLoggerOptional
- type ErrorFilterFunc
- type Factory
- type FactoryRequirementFlags
- type GlobalLogAdapter
- type InstrumentationConfig
- type Level
- type LogFlushFunc
- type LogFormat
- type LogLevelWriter
- type LogMetricsMode
- type LogMetricsRecorder
- type LoggerOutput
- type MetricsHelper
- func (p *MetricsHelper) GetMetricsCollector() logfmt.LogObjectMetricCollector
- func (p *MetricsHelper) GetOnWriteDurationReport() DurationReportFunc
- func (p *MetricsHelper) OnFilteredEvent(ctx context.Context, level Level)
- func (p *MetricsHelper) OnNewEvent(ctx context.Context, level Level)
- func (p *MetricsHelper) OnWriteDuration(d time.Duration)
- func (p *MetricsHelper) OnWriteSkip(skippedCount int)
- type NewLoggerParams
- type OutputConfig
- type Template
- type TestingLogger
- type TestingLoggerOutput
- func (r *TestingLoggerOutput) Close() error
- func (r *TestingLoggerOutput) Flush() error
- func (r *TestingLoggerOutput) IsLowLatencySupported() bool
- func (r *TestingLoggerOutput) LogLevelWrite(level Level, b []byte) (int, error)
- func (r *TestingLoggerOutput) LowLatencyWrite(level Level, b []byte) (int, error)
- func (r *TestingLoggerOutput) Write(b []byte) (int, error)
- type TestingLoggerWrapper
Constants ¶
const MinLevel = DebugLevel
Variables ¶
This section is empty.
Functions ¶
func GetLogLevelContext ¶
func IsBasedOn ¶
func IsBasedOn(t, lookFor TestingLogger) bool
Types ¶
type BareOutput ¶
type BareOutput struct { Writer io.Writer FlushFn LogFlushFunc ProtectedClose bool }
type BuildConfig ¶
type BuildConfig struct { Output OutputConfig Instruments InstrumentationConfig }
type CallerFieldMode ¶
type CallerFieldMode uint8
const ( NoCallerField CallerFieldMode = iota CallerField CallerFieldWithFuncName )
type Config ¶
type Config struct { BuildConfig BareOutput BareOutput LoggerOutput LoggerOutput Metrics *MetricsHelper MsgFormat logfmt.MsgFormatConfig ErrorFn func(error) }
type CopyLoggerParams ¶
type CopyLoggerParams struct { Reqs FactoryRequirementFlags Level Level AppendFields map[string]interface{} AppendDynFields DynFieldMap }
type DurationReportFunc ¶
type DynFieldFunc ¶
type DynFieldFunc func() interface{}
type DynFieldMap ¶
type DynFieldMap map[string]DynFieldFunc
type EmbeddedLogger ¶
type EmbeddedLogger interface { NewEventStruct(level Level) func(interface{}, []logfmt.LogFieldMarshaller) NewEvent(level Level) func(args []interface{}) NewEventFmt(level Level) func(fmt string, args []interface{}) // Does flushing of an underlying buffer. Implementation and factual output may vary. EmbeddedFlush(msg string) Is(Level) bool Copy() EmbeddedLoggerBuilder FieldsOf(reflect.Value) logfmt.LogObjectMarshaller }
type EmbeddedLoggerBuilder ¶
type EmbeddedLoggerBuilder interface { Template GetGlobalLogAdapter() GlobalLogAdapter GetLoggerOutput() LoggerOutput }
type EmbeddedLoggerMock ¶
type EmbeddedLoggerMock struct { CopyMock mEmbeddedLoggerMockCopy EmbeddedFlushMock mEmbeddedLoggerMockEmbeddedFlush FieldsOfMock mEmbeddedLoggerMockFieldsOf IsMock mEmbeddedLoggerMockIs NewEventMock mEmbeddedLoggerMockNewEvent NewEventFmtMock mEmbeddedLoggerMockNewEventFmt NewEventStructMock mEmbeddedLoggerMockNewEventStruct // contains filtered or unexported fields }
EmbeddedLoggerMock implements EmbeddedLogger
func NewEmbeddedLoggerMock ¶
func NewEmbeddedLoggerMock(t minimock.Tester) *EmbeddedLoggerMock
NewEmbeddedLoggerMock returns a mock for EmbeddedLogger
func (*EmbeddedLoggerMock) Copy ¶
func (mmCopy *EmbeddedLoggerMock) Copy() (e1 EmbeddedLoggerBuilder)
Copy implements EmbeddedLogger
func (*EmbeddedLoggerMock) CopyAfterCounter ¶
func (mmCopy *EmbeddedLoggerMock) CopyAfterCounter() uint64
CopyAfterCounter returns a count of finished EmbeddedLoggerMock.Copy invocations
func (*EmbeddedLoggerMock) CopyBeforeCounter ¶
func (mmCopy *EmbeddedLoggerMock) CopyBeforeCounter() uint64
CopyBeforeCounter returns a count of EmbeddedLoggerMock.Copy invocations
func (*EmbeddedLoggerMock) EmbeddedFlush ¶
func (mmEmbeddedFlush *EmbeddedLoggerMock) EmbeddedFlush(msg string)
EmbeddedFlush implements EmbeddedLogger
func (*EmbeddedLoggerMock) EmbeddedFlushAfterCounter ¶
func (mmEmbeddedFlush *EmbeddedLoggerMock) EmbeddedFlushAfterCounter() uint64
EmbeddedFlushAfterCounter returns a count of finished EmbeddedLoggerMock.EmbeddedFlush invocations
func (*EmbeddedLoggerMock) EmbeddedFlushBeforeCounter ¶
func (mmEmbeddedFlush *EmbeddedLoggerMock) EmbeddedFlushBeforeCounter() uint64
EmbeddedFlushBeforeCounter returns a count of EmbeddedLoggerMock.EmbeddedFlush invocations
func (*EmbeddedLoggerMock) FieldsOf ¶
func (mmFieldsOf *EmbeddedLoggerMock) FieldsOf(v1 reflect.Value) (l1 logfmt.LogObjectMarshaller)
FieldsOf implements EmbeddedLogger
func (*EmbeddedLoggerMock) FieldsOfAfterCounter ¶
func (mmFieldsOf *EmbeddedLoggerMock) FieldsOfAfterCounter() uint64
FieldsOfAfterCounter returns a count of finished EmbeddedLoggerMock.FieldsOf invocations
func (*EmbeddedLoggerMock) FieldsOfBeforeCounter ¶
func (mmFieldsOf *EmbeddedLoggerMock) FieldsOfBeforeCounter() uint64
FieldsOfBeforeCounter returns a count of EmbeddedLoggerMock.FieldsOf invocations
func (*EmbeddedLoggerMock) Is ¶
func (mmIs *EmbeddedLoggerMock) Is(l1 Level) (b1 bool)
Is implements EmbeddedLogger
func (*EmbeddedLoggerMock) IsAfterCounter ¶
func (mmIs *EmbeddedLoggerMock) IsAfterCounter() uint64
IsAfterCounter returns a count of finished EmbeddedLoggerMock.Is invocations
func (*EmbeddedLoggerMock) IsBeforeCounter ¶
func (mmIs *EmbeddedLoggerMock) IsBeforeCounter() uint64
IsBeforeCounter returns a count of EmbeddedLoggerMock.Is invocations
func (*EmbeddedLoggerMock) MinimockCopyDone ¶
func (m *EmbeddedLoggerMock) MinimockCopyDone() bool
MinimockCopyDone returns true if the count of the Copy invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockCopyInspect ¶
func (m *EmbeddedLoggerMock) MinimockCopyInspect()
MinimockCopyInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockEmbeddedFlushDone ¶
func (m *EmbeddedLoggerMock) MinimockEmbeddedFlushDone() bool
MinimockEmbeddedFlushDone returns true if the count of the EmbeddedFlush invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockEmbeddedFlushInspect ¶
func (m *EmbeddedLoggerMock) MinimockEmbeddedFlushInspect()
MinimockEmbeddedFlushInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockFieldsOfDone ¶
func (m *EmbeddedLoggerMock) MinimockFieldsOfDone() bool
MinimockFieldsOfDone returns true if the count of the FieldsOf invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockFieldsOfInspect ¶
func (m *EmbeddedLoggerMock) MinimockFieldsOfInspect()
MinimockFieldsOfInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockFinish ¶
func (m *EmbeddedLoggerMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*EmbeddedLoggerMock) MinimockIsDone ¶
func (m *EmbeddedLoggerMock) MinimockIsDone() bool
MinimockIsDone returns true if the count of the Is invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockIsInspect ¶
func (m *EmbeddedLoggerMock) MinimockIsInspect()
MinimockIsInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockNewEventDone ¶
func (m *EmbeddedLoggerMock) MinimockNewEventDone() bool
MinimockNewEventDone returns true if the count of the NewEvent invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockNewEventFmtDone ¶
func (m *EmbeddedLoggerMock) MinimockNewEventFmtDone() bool
MinimockNewEventFmtDone returns true if the count of the NewEventFmt invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockNewEventFmtInspect ¶
func (m *EmbeddedLoggerMock) MinimockNewEventFmtInspect()
MinimockNewEventFmtInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockNewEventInspect ¶
func (m *EmbeddedLoggerMock) MinimockNewEventInspect()
MinimockNewEventInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockNewEventStructDone ¶
func (m *EmbeddedLoggerMock) MinimockNewEventStructDone() bool
MinimockNewEventStructDone returns true if the count of the NewEventStruct invocations corresponds the number of defined expectations
func (*EmbeddedLoggerMock) MinimockNewEventStructInspect ¶
func (m *EmbeddedLoggerMock) MinimockNewEventStructInspect()
MinimockNewEventStructInspect logs each unmet expectation
func (*EmbeddedLoggerMock) MinimockWait ¶
func (m *EmbeddedLoggerMock) MinimockWait(timeout mm_time.Duration)
MinimockWait waits for all mocked methods to be called the expected number of times
func (*EmbeddedLoggerMock) NewEvent ¶
func (mmNewEvent *EmbeddedLoggerMock) NewEvent(level Level) (f1 func(args []interface{}))
NewEvent implements EmbeddedLogger
func (*EmbeddedLoggerMock) NewEventAfterCounter ¶
func (mmNewEvent *EmbeddedLoggerMock) NewEventAfterCounter() uint64
NewEventAfterCounter returns a count of finished EmbeddedLoggerMock.NewEvent invocations
func (*EmbeddedLoggerMock) NewEventBeforeCounter ¶
func (mmNewEvent *EmbeddedLoggerMock) NewEventBeforeCounter() uint64
NewEventBeforeCounter returns a count of EmbeddedLoggerMock.NewEvent invocations
func (*EmbeddedLoggerMock) NewEventFmt ¶
func (mmNewEventFmt *EmbeddedLoggerMock) NewEventFmt(level Level) (f1 func(fmt string, args []interface{}))
NewEventFmt implements EmbeddedLogger
func (*EmbeddedLoggerMock) NewEventFmtAfterCounter ¶
func (mmNewEventFmt *EmbeddedLoggerMock) NewEventFmtAfterCounter() uint64
NewEventFmtAfterCounter returns a count of finished EmbeddedLoggerMock.NewEventFmt invocations
func (*EmbeddedLoggerMock) NewEventFmtBeforeCounter ¶
func (mmNewEventFmt *EmbeddedLoggerMock) NewEventFmtBeforeCounter() uint64
NewEventFmtBeforeCounter returns a count of EmbeddedLoggerMock.NewEventFmt invocations
func (*EmbeddedLoggerMock) NewEventStruct ¶
func (mmNewEventStruct *EmbeddedLoggerMock) NewEventStruct(level Level) (f1 func(interface{}, []logfmt.LogFieldMarshaller))
NewEventStruct implements EmbeddedLogger
func (*EmbeddedLoggerMock) NewEventStructAfterCounter ¶
func (mmNewEventStruct *EmbeddedLoggerMock) NewEventStructAfterCounter() uint64
NewEventStructAfterCounter returns a count of finished EmbeddedLoggerMock.NewEventStruct invocations
func (*EmbeddedLoggerMock) NewEventStructBeforeCounter ¶
func (mmNewEventStruct *EmbeddedLoggerMock) NewEventStructBeforeCounter() uint64
NewEventStructBeforeCounter returns a count of EmbeddedLoggerMock.NewEventStruct invocations
type EmbeddedLoggerMockCopyExpectation ¶
type EmbeddedLoggerMockCopyExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockCopyExpectation specifies expectation struct of the EmbeddedLogger.Copy
type EmbeddedLoggerMockCopyResults ¶
type EmbeddedLoggerMockCopyResults struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockCopyResults contains results of the EmbeddedLogger.Copy
type EmbeddedLoggerMockEmbeddedFlushExpectation ¶
type EmbeddedLoggerMockEmbeddedFlushExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockEmbeddedFlushExpectation specifies expectation struct of the EmbeddedLogger.EmbeddedFlush
type EmbeddedLoggerMockEmbeddedFlushParams ¶
type EmbeddedLoggerMockEmbeddedFlushParams struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockEmbeddedFlushParams contains parameters of the EmbeddedLogger.EmbeddedFlush
type EmbeddedLoggerMockFieldsOfExpectation ¶
type EmbeddedLoggerMockFieldsOfExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockFieldsOfExpectation specifies expectation struct of the EmbeddedLogger.FieldsOf
func (*EmbeddedLoggerMockFieldsOfExpectation) Then ¶
func (e *EmbeddedLoggerMockFieldsOfExpectation) Then(l1 logfmt.LogObjectMarshaller) *EmbeddedLoggerMock
Then sets up EmbeddedLogger.FieldsOf return parameters for the expectation previously defined by the When method
type EmbeddedLoggerMockFieldsOfParams ¶
type EmbeddedLoggerMockFieldsOfParams struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockFieldsOfParams contains parameters of the EmbeddedLogger.FieldsOf
type EmbeddedLoggerMockFieldsOfResults ¶
type EmbeddedLoggerMockFieldsOfResults struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockFieldsOfResults contains results of the EmbeddedLogger.FieldsOf
type EmbeddedLoggerMockIsExpectation ¶
type EmbeddedLoggerMockIsExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockIsExpectation specifies expectation struct of the EmbeddedLogger.Is
func (*EmbeddedLoggerMockIsExpectation) Then ¶
func (e *EmbeddedLoggerMockIsExpectation) Then(b1 bool) *EmbeddedLoggerMock
Then sets up EmbeddedLogger.Is return parameters for the expectation previously defined by the When method
type EmbeddedLoggerMockIsParams ¶
type EmbeddedLoggerMockIsParams struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockIsParams contains parameters of the EmbeddedLogger.Is
type EmbeddedLoggerMockIsResults ¶
type EmbeddedLoggerMockIsResults struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockIsResults contains results of the EmbeddedLogger.Is
type EmbeddedLoggerMockNewEventExpectation ¶
type EmbeddedLoggerMockNewEventExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockNewEventExpectation specifies expectation struct of the EmbeddedLogger.NewEvent
func (*EmbeddedLoggerMockNewEventExpectation) Then ¶
func (e *EmbeddedLoggerMockNewEventExpectation) Then(f1 func(args []interface{})) *EmbeddedLoggerMock
Then sets up EmbeddedLogger.NewEvent return parameters for the expectation previously defined by the When method
type EmbeddedLoggerMockNewEventFmtExpectation ¶
type EmbeddedLoggerMockNewEventFmtExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockNewEventFmtExpectation specifies expectation struct of the EmbeddedLogger.NewEventFmt
func (*EmbeddedLoggerMockNewEventFmtExpectation) Then ¶
func (e *EmbeddedLoggerMockNewEventFmtExpectation) Then(f1 func(fmt string, args []interface{})) *EmbeddedLoggerMock
Then sets up EmbeddedLogger.NewEventFmt return parameters for the expectation previously defined by the When method
type EmbeddedLoggerMockNewEventFmtParams ¶
type EmbeddedLoggerMockNewEventFmtParams struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockNewEventFmtParams contains parameters of the EmbeddedLogger.NewEventFmt
type EmbeddedLoggerMockNewEventFmtResults ¶
type EmbeddedLoggerMockNewEventFmtResults struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockNewEventFmtResults contains results of the EmbeddedLogger.NewEventFmt
type EmbeddedLoggerMockNewEventParams ¶
type EmbeddedLoggerMockNewEventParams struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockNewEventParams contains parameters of the EmbeddedLogger.NewEvent
type EmbeddedLoggerMockNewEventResults ¶
type EmbeddedLoggerMockNewEventResults struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockNewEventResults contains results of the EmbeddedLogger.NewEvent
type EmbeddedLoggerMockNewEventStructExpectation ¶
type EmbeddedLoggerMockNewEventStructExpectation struct { Counter uint64 // contains filtered or unexported fields }
EmbeddedLoggerMockNewEventStructExpectation specifies expectation struct of the EmbeddedLogger.NewEventStruct
func (*EmbeddedLoggerMockNewEventStructExpectation) Then ¶
func (e *EmbeddedLoggerMockNewEventStructExpectation) Then(f1 func(interface{}, []logfmt.LogFieldMarshaller)) *EmbeddedLoggerMock
Then sets up EmbeddedLogger.NewEventStruct return parameters for the expectation previously defined by the When method
type EmbeddedLoggerMockNewEventStructParams ¶
type EmbeddedLoggerMockNewEventStructParams struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockNewEventStructParams contains parameters of the EmbeddedLogger.NewEventStruct
type EmbeddedLoggerMockNewEventStructResults ¶
type EmbeddedLoggerMockNewEventStructResults struct {
// contains filtered or unexported fields
}
EmbeddedLoggerMockNewEventStructResults contains results of the EmbeddedLogger.NewEventStruct
type EmbeddedLoggerOptional ¶
type EmbeddedLoggerOptional interface { WithFields(fields map[string]interface{}) EmbeddedLogger WithField(name string, value interface{}) EmbeddedLogger }
type ErrorFilterFunc ¶
ErrorFilterFunc should return true to pass error and false to ignore it
type Factory ¶
type Factory interface { PrepareBareOutput(output BareOutput, metrics *MetricsHelper, config BuildConfig) (io.Writer, error) CreateNewLogger(params NewLoggerParams) (EmbeddedLogger, error) CanReuseMsgBuffer() bool }
type FactoryRequirementFlags ¶
type FactoryRequirementFlags uint8
const ( RequiresLowLatency FactoryRequirementFlags = 1 << iota RequiresParentCtxFields RequiresParentDynFields )
type GlobalLogAdapter ¶
type InstrumentationConfig ¶
type InstrumentationConfig struct { Recorder LogMetricsRecorder MetricsMode LogMetricsMode CallerMode CallerFieldMode SkipFrameCountBaseline uint8 SkipFrameCount int8 }
func (InstrumentationConfig) CanReuseOutputFor ¶
func (v InstrumentationConfig) CanReuseOutputFor(config InstrumentationConfig) bool
type Level ¶
type Level uint8
const ( Disabled Level = iota DebugLevel InfoLevel WarnLevel ErrorLevel PanicLevel FatalLevel NoLevel LogLevelCount = iota )
NoLevel means it should be ignored
func ParseLevel ¶
type LogFlushFunc ¶
type LogFlushFunc func() error
type LogLevelWriter ¶
type LogMetricsMode ¶
type LogMetricsMode uint8
const ( // Logger will report every event to metrics LogMetricsEventCount LogMetricsMode = 1 << iota // Logger will report to metrics a write duration (time since an event was created till it was directed to the output) LogMetricsWriteDelayReport // Logger will add a write duration field into to the output LogMetricsWriteDelayField // Logger will add a timestamp to every event LogMetricsTimestamp // No effect on logger. Indicates that WithMetrics should replace the mode, instead of adding it. LogMetricsResetMode )
const NoLogMetrics LogMetricsMode = 0
func (LogMetricsMode) HasWriteMetric ¶
func (v LogMetricsMode) HasWriteMetric() bool
type LogMetricsRecorder ¶
type LoggerOutput ¶
type MetricsHelper ¶
type MetricsHelper struct {
// contains filtered or unexported fields
}
func NewMetricsHelper ¶
func NewMetricsHelper(recorder LogMetricsRecorder) *MetricsHelper
func (*MetricsHelper) GetMetricsCollector ¶
func (p *MetricsHelper) GetMetricsCollector() logfmt.LogObjectMetricCollector
func (*MetricsHelper) GetOnWriteDurationReport ¶
func (p *MetricsHelper) GetOnWriteDurationReport() DurationReportFunc
func (*MetricsHelper) OnFilteredEvent ¶
func (p *MetricsHelper) OnFilteredEvent(ctx context.Context, level Level)
func (*MetricsHelper) OnNewEvent ¶
func (p *MetricsHelper) OnNewEvent(ctx context.Context, level Level)
func (*MetricsHelper) OnWriteDuration ¶
func (p *MetricsHelper) OnWriteDuration(d time.Duration)
func (*MetricsHelper) OnWriteSkip ¶
func (p *MetricsHelper) OnWriteSkip(skippedCount int)
type NewLoggerParams ¶
type NewLoggerParams struct { Reqs FactoryRequirementFlags Level Level Fields map[string]interface{} DynFields DynFieldMap Config Config }
type OutputConfig ¶
type OutputConfig struct { BufferSize int ParallelWriters int Format LogFormat // allow buffer for regular events EnableRegularBuffer bool }
func (OutputConfig) CanReuseOutputFor ¶
func (v OutputConfig) CanReuseOutputFor(config OutputConfig) bool
type Template ¶
type Template interface { Factory GetTemplateConfig() Config GetTemplateLevel() Level // NB! Must ignore RequiresLowLatency flag CopyTemplateLogger(CopyLoggerParams) EmbeddedLogger }
type TestingLogger ¶
type TestingLogger interface { Helper() Log(...interface{}) Error(...interface{}) Fatal(...interface{}) }
this interface matches required *testing.T
type TestingLoggerOutput ¶
type TestingLoggerOutput struct {
Output, EchoTo io.Writer
Testing TestingLogger
InterceptFatal func([]byte) bool
ErrorFilterFn ErrorFilterFunc
LogFiltered bool
}
func (*TestingLoggerOutput) Close ¶
func (r *TestingLoggerOutput) Close() error
func (*TestingLoggerOutput) Flush ¶
func (r *TestingLoggerOutput) Flush() error
func (*TestingLoggerOutput) IsLowLatencySupported ¶
func (r *TestingLoggerOutput) IsLowLatencySupported() bool
func (*TestingLoggerOutput) LogLevelWrite ¶
func (r *TestingLoggerOutput) LogLevelWrite(level Level, b []byte) (int, error)
func (*TestingLoggerOutput) LowLatencyWrite ¶
func (r *TestingLoggerOutput) LowLatencyWrite(level Level, b []byte) (int, error)
type TestingLoggerWrapper ¶
type TestingLoggerWrapper interface {
UnwrapTesting() TestingLogger
}