log

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: GPL-3.0 Imports: 1 Imported by: 2

README

buggy-log, a simple Go logging package

This is a simple and minimal logging utility for the Go language. We use this utility for several i2c drivers but might shift away to the standard log utility. Either way, this is a nice way to get familiar with publishing Go modules.

Installation

go get github.com/MrBuggy-Amsterdam/buggy-log/

Usage

As you would expect from a logging utility. By default, debug level prints are hidden.

package main

import (
    github.com/MrBuggy-Amsterdam/buggy-log/
)

func main() {
    log.SetVerbosity(log.DebugLevel)
    log.Debug("Hey, can you read this?")
    log.Debug("Of course, include %s as well", "formatting")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, a ...any)

func Error

func Error(format string, a ...any)

func Fatal

func Fatal(format string, a ...any)

func Info

func Info(format string, a ...any)

func SetVerbosity

func SetVerbosity(level Level)

func Success

func Success(format string, a ...any)

func Warn

func Warn(format string, a ...any)

Types

type Level

type Level int

Logging levels

const (
	DebugLevel   Level = 0
	InfoLevel    Level = 1
	SuccessLevel Level = 2
	WarningLevel Level = 3
	ErrorLevel   Level = 4
)

Jump to

Keyboard shortcuts

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