logger

package
v0.0.0-...-d363ebf Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logger exposes a simple logging interface for the application. The package is responsible for writing all application logs, which, by default, are written at to `stderr` for events at warn level or above.

The behavior of the logger can be modified using the `logger.Log()` function to write all logs at debug level or above to `stderr`, and a text file named `logs.txt`

To safely close the logger, use `logger.Stop()`

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug writes log messages to the `debug` level

func Debugf

func Debugf(message string, args ...interface{})

Debugf uses `fmt.Sprintf` style formatting to log messages at the `debug` level

func Error

func Error(args ...interface{})

Error writes log messages at the `error` level

func Errorf

func Errorf(template string, args ...interface{})

Errorf uses `fmt.Sprintf` style formatting to log messages at the `error` level

func Info

func Info(args ...interface{})

Info writes log messages at the `info` level

func Infof

func Infof(template string, args ...interface{})

Infof uses `fmt.Sprintf` style formatting to log messages at the `info` level

func Log

func Log(writeToFile bool) (err error)

Log modifies the logger to log events at or above zap.DebugLevel, and write logs to a file

func Stop

func Stop() error

Stop closes the logger gracefully

func Warn

func Warn(args ...interface{})

Warn writes log messages at the `warn` level

func Warnf

func Warnf(msg string, args ...interface{})

Warnf uses `fmt.Sprintf` style formatting to log messages at the `warn` level

Types

This section is empty.

Jump to

Keyboard shortcuts

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