logger

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 5 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLogger

func DisableLogger()

DisableLogger disabled the logger (must be called before InitLogger())

func InitLogger

func InitLogger(projectName string)

InitLogger initializes the parent logger and sets the project's name

Types

type Log

type Log struct {
	bunyan.Log
}

Log provides the base structure for a extended logger

The loglevel can be controller via the config property "loglevel" or the environment variable LOGLEVEL

func GetLogger

func GetLogger(componentName string) *Log

GetLogger returns a logger for a specific component

func (*Log) ErrorfX

func (l *Log) ErrorfX(msg string, args ...interface{}) error

ErrorfX logs an error and returns it

func (*Log) RecordX

func (l *Log) RecordX(key string, value interface{}) *Log

RecordX returns a new Logger with a specified Record assigned

func (*Log) RecordfX

func (l *Log) RecordfX(key, value string, args ...interface{}) *Log

RecordfX returns a new Logger with a specified formatted Record assigned

func (*Log) SiemEvent

func (l *Log) SiemEvent(event *siem.Event, msg string, args ...interface{})

SiemEvent logs an siem event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL