log

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 4 Imported by: 2

README

LOG

Minimalist log with semantic API and multi level lable.

GoDoc

package main

import "github.com/omeid/log"

func main() {
  l := log.New("")

  l.Info("I don't have a label. :(")
  l.Warn("This is a warning.")
  l.Error("This is a phony error.")

  c := l.New("child: ")
  c.Info("Check out my label!")
  c = c.New("grandchild: ")
  c.Notice("See, we can go deeper!")
}

Will produce:

[INFO] I don't have a label. :( 
[WARN] This is a warning. 
[ERR!] This is a phony error. 
[INFO] child: Check out my label! 
[NOTE] child: grandchild: See, we can go deeper! 
LICENSE

MIT.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Flags int

Functions

This section is empty.

Types

type Log

type Log interface {
	Log(v ...interface{})
	Logf(format string, v ...interface{})

	Info(v ...interface{})
	Infof(format string, v ...interface{})

	Notice(v ...interface{})
	Noticef(format string, v ...interface{})

	Warn(v ...interface{})
	Warnf(format string, v ...interface{})

	Error(v ...interface{})
	Errorf(format string, v ...interface{})

	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})

	New(string) Log
}

func New

func New(prefix string) Log

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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