log

package
v0.0.0-...-c9686b9 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

Package log provides a useful logging subsystem for Hologram tools.

By default, it will log INFO-level messages to the system log and standard out, but DEBUG-level messages can be output to these sinks as well. By defaut DEBUG messages are suppressed.

Messages emitted to the terminal are colourised for easy visual parsing, if the terminal supports it. The following colours are used:

  • Info: White
  • Warning: Yellow
  • Error: Red
  • Debug: Cyan

The log format is as follows:

[WARNING] 06/11/2014 18:22:34Z Message text. [ERROR ] 06/11/2014 18:22:56Z Time to fail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message string, v ...interface{})

func DebugMode

func DebugMode(status bool)

DebugMode sets the debug mode option for this built-in logger.

func Errorf

func Errorf(message string, v ...interface{})

func Info

func Info(message string, v ...interface{})

func NewColourisedTerminalSink

func NewColourisedTerminalSink() *terminalSink

Return a working logger that colourises output to the terminal according to level.

func NewMux

func NewMux() *logMux

func NewSyslogSink

func NewSyslogSink() *syslogSink

Return a working logger to Syslog.

func Warning

func Warning(message string, v ...interface{})

Types

type Sink

type Sink interface {
	Info(message string)
	Warning(message string)
	Error(message string)
	Debug(message string)
}

Sink implementers provide processing logic for messages emitted by Hologram programs.

Jump to

Keyboard shortcuts

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