Documentation ¶
Index ¶
- Constants
- type Logger
- type ZeroLogger
- func (l *ZeroLogger) Debug(_ context.Context, msg string)
- func (l *ZeroLogger) Error(_ context.Context, msg string)
- func (l *ZeroLogger) Info(_ context.Context, msg string)
- func (l *ZeroLogger) Trace(_ context.Context, msg string)
- func (l *ZeroLogger) Warn(_ context.Context, msg string)
- func (l *ZeroLogger) WithError(err error) Logger
- func (l *ZeroLogger) WithField(name string, value interface{}) Logger
Constants ¶
View Source
const DATA_DOCUMENTS = "data_documents"
View Source
const ERROR = "error"
View Source
const INPUT_TYPE = "input_type"
View Source
const JUDGEMENT_KEY = "judgement_key"
View Source
const JUDGEMENT_NAME = "judgement_name"
View Source
const MODULES = "modules"
View Source
const PACKAGE = "package"
View Source
const PATH = "path"
View Source
const POLICY_TYPE = "policy_type"
View Source
const RESOURCE_ID = "resource_id"
View Source
const RESOURCE_TYPE = "resource_type"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Trace(ctx context.Context, msg string) Debug(ctx context.Context, msg string) Info(ctx context.Context, msg string) Warn(ctx context.Context, msg string) Error(ctx context.Context, msg string) WithError(err error) Logger WithField(name string, value interface{}) Logger }
Logger defines a simple interface for the pluggable logging in the policy engine
var NopLogger Logger = NewZeroLogger(zerolog.Nop())
NopLogger does not write any messages. It can be used to disable logging.
var StdErrLogger Logger = NewZeroLogger(zerolog.Logger{}. Level(zerolog.GlobalLevel()). Output(os.Stderr). With().Timestamp().Logger())
StdErrLogger writes structured log messages to stderr
func NewZeroLogger ¶
type ZeroLogger ¶
type ZeroLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is an implementation of the Logger interface that uses zerolog internally.
func (*ZeroLogger) WithError ¶
func (l *ZeroLogger) WithError(err error) Logger
func (*ZeroLogger) WithField ¶
func (l *ZeroLogger) WithField(name string, value interface{}) Logger
Click to show internal directories.
Click to hide internal directories.