log

package
v0.0.0-...-51a7f25 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package log handles logging.

Index

Constants

View Source
const (
	// LoggerName is used to specify the source of the logger.
	LoggerName = "wso2-apim-broker"

	// FilePerm is the permission for the server log file.
	FilePerm = 0644

	ErrMsgUnableToOpenLogFile = "unable to open the Log file: %s"
)

Variables

This section is empty.

Functions

func Configure

func Configure(logFile, logLevelS string) (lager.Logger, error)

Configure initializes lager logging object, 1. Setup log level 2. Setup log file Returns configured logger and any error encountered.

func Debug

func Debug(msg string, data *Data)

Debug logs Debug level messages using configured lager.Logger.

func Error

func Error(msg string, err error, data *Data)

Error logs Error level messages using configured lager.Logger.

func HandleErrorAndExit

func HandleErrorAndExit(errMsg string, err error)

HandleErrorAndExit prints an error to STDOUT and invoke a panic.

func Info

func Info(msg string, data *Data)

Info logs Info level messages using configured lager.Logger.

func IoWriterLog

func IoWriterLog() io.Writer

IoWriterLog returns the IO writer object for logging. By default it is pointed to STDOUT.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data represents the information in the logs.

func NewData

func NewData() *Data

NewData returns a pointer a Data struct.

func (*Data) Add

func (l *Data) Add(key string, val interface{}) *Data

Add adds data to current data obj. Returns a reference to the current Log data obj.

Jump to

Keyboard shortcuts

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