lwlogger

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

A Logger wrapper for Lacework based of zap logger Go package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogLevelEnv represents the level that the logger is configured
	LogLevelEnv        = "LW_LOG"
	SupportedLogLevels = [3]string{"", "INFO", "DEBUG"}

	// LogFormatEnv controls the format of the logger
	LogFormatEnv        = "LW_LOG_FORMAT"
	DefaultLogFormat    = "JSON"
	SupportedLogFormats = [2]string{"JSON", "CONSOLE"}

	// LogDevelopmentModeEnv switches the logger to development mode
	LogDevelopmentModeEnv = "LW_LOG_DEV"

	// LogToNativeLoggerEnv is used for those consumers like terraform that control
	// the logs that are presented to the user, when this environment is turned
	// on, the logger implementation will use the native Go logger 'log.Writer()'
	LogToNativeLoggerEnv = "LW_LOG_NATIVE"
)

Functions

func LogLevelFromEnvironment

func LogLevelFromEnvironment() string

LogLevelFromEnvironment checks the environment variable 'LW_LOG'

func New

func New(level string, options ...zap.Option) *zap.Logger

New initialize a new logger with the provided level and options

func NewWithWriter

func NewWithWriter(level string, out io.Writer, options ...zap.Option) *zap.Logger

NewWithWriter initialize a new logger with the provided level and options but redirecting the logs to the provider io.Writer

func ValidLevel

func ValidLevel(level string) bool

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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