waLog

package
v0.0.0-...-b6c8c77 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package waLog contains a simple logger interface used by the other whatsmeow packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Warnf(msg string, args ...interface{})
	Errorf(msg string, args ...interface{})
	Infof(msg string, args ...interface{})
	Debugf(msg string, args ...interface{})
	Sub(module string) Logger
}

Logger is a simple logger interface that can have subloggers for specific areas.

var Noop Logger = &noopLogger{}

Noop is a no-op Logger implementation that silently drops everything.

func Stdout

func Stdout(module string, minLevel string, color bool) Logger

Stdout is a simple Logger implementation that outputs to stdout. The module name given is included in log lines.

minLevel specifies the minimum log level to output. An empty string will output all logs.

If color is true, then info, warn and error logs will be colored cyan, yellow and red respectively using ANSI color escape codes.

Jump to

Keyboard shortcuts

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