Categorygithub.com/phogolabs/log
repositorypackage
0.0.0-20230111045248-dad4d3c50e0f
Repository: https://github.com/phogolabs/log.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

LOG

Documentation License Build Status Coverage Go Report Card

A simple logger for Golang

Installation

$ go get -u github.com/phogolabs/log

Getting started

import (
  "github.com/phogolabs/log"
  "github.com/phogolabs/log/console"
)

log.SetHandler(console.New(os.Stdout))

logger := log.WithFields(log.F("app", "service-api"))
logger.Info("Hello")

Levels

LevelDescription
DEBUGInfo useful to developers for debugging the application not useful during operations.
INFONormal operational messages - may be harvested for reporting measuring throughput etc. - no action required.
NOTICENormal but significant condition. Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required.
WARNWarning messages not an error but indication that an error will occur if action is not taken e.g. file system 85% full - each item must be resolved within a given time.
ERRORNon-urgent failures; these should be relayed to developers or admins; each item must be resolved within a given time.
PANIC"A ""panic"" condition usually affecting multiple apps/servers/sites. At this level it would usually notify all tech staff on call."
ALERT"Action must be taken immediately. Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection."
FATAL"Should be corrected immediately, but indicates failure in a primary system; an example is a loss of a backup ISP connection. (same as SYSLOG CRITICAL)"

Contributing

We are open for any contributions. Just fork the project.