kttlog

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

kttlog is the package specifying logging information used throughout the ecosystem. It contains helper functions to make management of logging easier.

Index

Constants

This section is empty.

Variables

View Source
var Logger *zerolog.Logger

Functions

func AddHook added in v0.0.2

func AddHook(hook zerolog.Hook)

AddHook adds a hook to the list of hooks, then rebuilds the logger

func AddWriter

func AddWriter(w io.Writer)

AddWriter adds an io.Writer to the list of writers, then rebuilds the logger

func EnableConsoleLog

func EnableConsoleLog()

EnableConsoleLog enables the console logger (this is enabled by default, but is disabled if ResetLogger is called)

func EnableFileLog

func EnableFileLog(path string) error

EnableFileLog enables the file logger and sets the log file to the given path

func EnableLocalSyslog

func EnableLocalSyslog() error

EnableLocalSyslog enables the local syslog logger, according to the native syslog package

func EnableNetworkSyslog

func EnableNetworkSyslog(network, addr string) error

EnableNetworkSyslog enables the network syslog logger and sets the syslog server to the given host:port

func RebuildLogger

func RebuildLogger()

RebuildLogger rebuilds the logger with the current list of writers and hooks

func ResetLogger

func ResetLogger()

ResetLogger resets the logger to the default zerolog.Logger, removing all writers and hooks

func SetKTTLogger

func SetKTTLogger(l zerolog.Logger)

SetKTTLogger sets the logger to the given zerolog.Logger struct

func SetLevel

func SetLevel(level zerolog.Level)

SetLevel sets the log level to a given zerolog.Level

func SetLevelStr

func SetLevelStr(level string)

SetLevelStr sets the log level to a given string

Types

This section is empty.

Jump to

Keyboard shortcuts

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