logging

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2021 IBM Corp. SPDX-License-Identifier: Apache-2.0

Copyright 2022 IBM Corp. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	CONTROLLER string = "controller" // A control plane controller
	MODULE     string = "module"     // A fybrikmodule that describes a deployable or pre-deployed service
	CONNECTOR  string = "connector"  // A component that connects an external system to the fybrik control plane - data governance,
	// policy manager, data catalog, credential manager
	SERVICE string = "service" // A data plane service - the service itself, not the module that describes it
	SETUP   string = "setup"   // Used by main function that initializes the control plane
	WEBHOOK string = "webhook"
)

Component Types

View Source
const (
	DELETE string = "delete"
	CREATE string = "create"
	UPDATE string = "update"
)

Action Types

View Source
const (
	ACTION       string = "action"       // optional
	DATASETID    string = "dataSetID"    // optional
	FORUSER      string = "forUser"      // optional
	AUDIT        string = "audit"        // optional
	CLUSTER      string = "cluster"      // optional
	PLOTTER      string = "plotter"      // optional
	BLUEPRINT    string = "blueprint"    // optional
	NAME         string = "name"         // optional
	NAMESPACE    string = "namespace"    // optional
	RESPONSETIME string = "responseTime" // optional
)

Log Entry Params - those listed in the constants below and FybrikApplicationUUID defined in fybrik.io/manager/utils/utils.go caller (file and line), error, message, timestamp - Provided by the logging mechanism Cluster will not be included since not all components know how to determine on which cluster they run. Instead it will be assumed that the logging agents will add this information as they gather the logs.

View Source
const SKIP = 2

Variables

This section is empty.

Functions

func GetLoggingVerbosity

func GetLoggingVerbosity() zerolog.Level

GetLoggingVerbosity returns the level as per https://github.com/rs/zerolog#leveled-logging

func LogInit

func LogInit(callerType, callerName string) zerolog.Logger

LogInit insures that all log entries have a cluster, timestamp, caller type, file and line from which it was called. FybrikAppUuid is mandatory as well, but is not known when the logger is initialized.

func LogStructure

func LogStructure(argName string, argStruct interface{}, log *zerolog.Logger, verbosity zerolog.Level, forUser, audit bool)

LogStructure prints out the provided structure to the log in json format.

func NewLogger added in v1.1.0

func NewLogger() logr.Logger

NewLogger creates a new logr.Logger using zerolog.Logger to preserve the logging format

func PrettyLogging

func PrettyLogging() bool

GetPrettyLogging returns the indication of whether logs should be human readable or pure json

Types

type Writer added in v1.1.0

type Writer struct {
	Log       *zerolog.Logger
	Verbosity zerolog.Level
	Depth     int
	Caller    string
}

func (*Writer) Enabled added in v1.1.0

func (w *Writer) Enabled(lvl int) bool

func (*Writer) Error added in v1.1.0

func (w *Writer) Error(err error, msg string, keysAndVals ...interface{})

func (*Writer) Info added in v1.1.0

func (w *Writer) Info(lvl int, msg string, keysAndVals ...interface{})

func (*Writer) Init added in v1.1.0

func (w *Writer) Init(ri logr.RuntimeInfo)

ignoring CallDepth

func (*Writer) WithCallDepth added in v1.1.0

func (w *Writer) WithCallDepth(depth int) logr.LogSink

func (*Writer) WithName added in v1.1.0

func (w *Writer) WithName(name string) logr.LogSink

func (*Writer) WithValues added in v1.1.0

func (w *Writer) WithValues(keysAndValues ...interface{}) logr.LogSink

Jump to

Keyboard shortcuts

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