Documentation
¶
Overview ¶
Copyright 2021 IBM Corp. SPDX-License-Identifier: Apache-2.0
Copyright 2022 IBM Corp. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func GetLoggingVerbosity() zerolog.Level
- func LogInit(callerType, callerName string) zerolog.Logger
- func LogStructure(argName string, argStruct interface{}, log *zerolog.Logger, ...)
- func NewLogger() logr.Logger
- func PrettyLogging() bool
- type Writer
- func (w *Writer) Enabled(lvl int) bool
- func (w *Writer) Error(err error, msg string, keysAndVals ...interface{})
- func (w *Writer) Info(lvl int, msg string, keysAndVals ...interface{})
- func (w *Writer) Init(ri logr.RuntimeInfo)
- func (w *Writer) WithCallDepth(depth int) logr.LogSink
- func (w *Writer) WithName(name string) logr.LogSink
- func (w *Writer) WithValues(keysAndValues ...interface{}) logr.LogSink
Constants ¶
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
const ( DELETE string = "delete" CREATE string = "create" UPDATE string = "update" )
Action Types
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.
const SKIP = 2
Variables ¶
This section is empty.
Functions ¶
func GetLoggingVerbosity ¶
GetLoggingVerbosity returns the level as per https://github.com/rs/zerolog#leveled-logging
func LogInit ¶
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
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