 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func New(level string, opts ...any)
- func OnExit()
- type Logger
- type Option
- type Resource
- type ResourceOption
- type Syncer
- type WrappedLogger
- func (l *WrappedLogger) Check(lvl string) bool
- func (wl *WrappedLogger) Close()
- func (l *WrappedLogger) DebugR(msg string, args ...any)
- func (l *WrappedLogger) ErrorR(msg string, args ...any)
- func (l *WrappedLogger) InfoR(msg string, args ...any)
- func (wl *WrappedLogger) WithIndex(key, value string) *WrappedLogger
- func (wl *WrappedLogger) WithOptions(opts ...Option) *WrappedLogger
- func (wl *WrappedLogger) WithServiceName(servicename string) *WrappedLogger
 
Constants ¶
      View Source
      
  
const ( DebugLevel = "DEBUG" InfoLevel = "INFO" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates 2 loggers (plain and sugared) as global variables according to the desired loglevel ("DEBUG", "NOOP", "TEST", default is "INFO"). Additionally log output from other loggers in 3rd-party packages is redirected to the INFO label of these loggers. Both ResourceOption and zap.Option types are supported option types. The zap.Options are passed on the to zap logger.
Types ¶
type Resource ¶
type Resource struct {
	// contains filtered or unexported fields
}
    Resource - the counter is initialised with a zero value which indicates that the uber correction is made (default).
type ResourceOption ¶
type ResourceOption func(*Resource)
func WithConsole ¶
func WithConsole() ResourceOption
func WithFile ¶
func WithFile(filename string) ResourceOption
type WrappedLogger ¶
type WrappedLogger struct {
	*zap.SugaredLogger
}
    var ( Sugar *WrappedLogger Recorded *observer.ObservedLogs )
func (*WrappedLogger) Check ¶ added in v0.16.2
func (l *WrappedLogger) Check(lvl string) bool
func (*WrappedLogger) Close ¶
func (wl *WrappedLogger) Close()
Close attempts to flush any buffered log entries.
func (*WrappedLogger) DebugR ¶
func (l *WrappedLogger) DebugR(msg string, args ...any)
func (*WrappedLogger) ErrorR ¶
func (l *WrappedLogger) ErrorR(msg string, args ...any)
func (*WrappedLogger) InfoR ¶
func (l *WrappedLogger) InfoR(msg string, args ...any)
func (*WrappedLogger) WithIndex ¶
func (wl *WrappedLogger) WithIndex(key, value string) *WrappedLogger
func (*WrappedLogger) WithOptions ¶
func (wl *WrappedLogger) WithOptions(opts ...Option) *WrappedLogger
func (*WrappedLogger) WithServiceName ¶
func (wl *WrappedLogger) WithServiceName(servicename string) *WrappedLogger
 Click to show internal directories. 
   Click to hide internal directories.