cout

package
v0.3.1-b6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cout is a simple log handeling solution for the c2 package. This is used internally to create loggers and to disable logging if needed, such as the "client" built tag being used.

Index

Constants

View Source
const Enabled = true

Enabled is a compile time constant that can be used to disable/enable the logx Logger and prevent any un-needed fmt calls as the client does not /naturally/ need to produce output.

Only needed for debug purposes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	logx.Log
}

Log is an interface for any type of struct that supports standard Logging functions.

func New

func New(l logx.Log) *Log

New creates a Log instance from a logx Logger.

func (*Log) Debug

func (l *Log) Debug(s string, v ...interface{})

Debug writes a debugging message to the logger. The function arguments are similar to fmt.Sprintf and fmt.Printf. The first argument is a string that can contain formatting characters. The second argument is a vardict of interfaces that can be omitted or used in the supplied format string.

func (*Log) Error

func (l *Log) Error(s string, v ...interface{})

Error writes a error message to the logger. The function arguments are similar to fmt.Sprintf and fmt.Printf. The first argument is a string that can contain formatting characters. The second argument is a vardict of interfaces that can be omitted or used in the supplied format string.

func (*Log) Info

func (l *Log) Info(s string, v ...interface{})

Info writes a informational message to the logger. The function arguments are similar to fmt.Sprintf and fmt.Printf. The first argument is a string that can contain formatting characters. The second argument is a vardict of interfaces that can be omitted or used in the supplied format string.

func (*Log) Set

func (l *Log) Set(v logx.Log)

Set updates the internal logger. This function is a NOP if the logger is nil or logging is not enabled via the 'client' build tag.

func (*Log) Trace

func (l *Log) Trace(s string, v ...interface{})

Trace writes a tracing message to the logger. The function arguments are similar to fmt.Sprintf and fmt.Printf. The first argument is a string that can contain formatting characters. The second argument is a vardict of interfaces that can be omitted or used in the supplied format string.

func (*Log) Warning

func (l *Log) Warning(s string, v ...interface{})

Warning writes a warning message to the logger. The function arguments are similar to fmt.Sprintf and fmt.Printf. The first argument is a string that can contain formatting characters. The second argument is a vardict of interfaces that can be omitted or used in the supplied format string.

Jump to

Keyboard shortcuts

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