koan

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MPL-2.0 Imports: 3 Imported by: 10 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Koan

GitHub go.mod Go version Go Report Card GitHub Workflow Status (branch) GitHub Release Date GitHub commits since latest release (by date) GitHub

About

A lightweight logging package for Go.

License

Licensed under Mozilla Public License 2.0

Documentation

Overview

Package koan provides utility logging functions designed to standardise and colorize the logged output

Index

Constants

View Source
const (
	INFOPREFIX     = "INFO"
	WARNPREFIX     = "WARN"
	ERRPREFIX      = "ERROR"
	FATALERRPREFIX = "FATAL ERROR"
	DEBUGPREFIX    = "DEBUG"
)

Variables

View Source
var (
	INFOCOLOR  = color.Gray
	WARNCOLOR  = color.Yellow
	ERRCOLOR   = color.Red
	DEBUGCOLOR = color.Green
)

Functions

This section is empty.

Types

type Logger

type Logger struct {
	DEBUG bool
}

Logger will hold configuration specific to the logger package

func (*Logger) Debug added in v0.2.0

func (l *Logger) Debug(msg string)

Debug provides additional logging if DEBUG is set on/true

func (*Logger) Error

func (*Logger) Error(msg string, err error)

Error provides logging with an Error prefix

func (*Logger) FatalError

func (*Logger) FatalError(msg string, err error)

FatalError provides logging with a FatalError prefix and terminates execution

func (*Logger) Info

func (*Logger) Info(msg string)

Info provides logging with an Info prefix

func (*Logger) Warn

func (*Logger) Warn(msg string)

Warn provides logging with a Warning prefix

Jump to

Keyboard shortcuts

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