Categorygithub.com/Strum355/log
modulepackage
1.1.0
Repository: https://github.com/strum355/log.git
Documentation: pkg.go.dev

# README

Stroom Log™

Build Status GoDoc Go report

Simple logger inspired by bwmarrin/lit with fields, opentracing and json output support.

Design Philosophy

The design of the API is inspired by Grafana's Loki log aggregation system and structured logging practices. As a result, it heavily favours using fields to log variable data and having log messages be the same regardless of the contextual data.

Example:

log.WithFields(log.Fields{
    "userId": user.id,
    "requestId": requestId,
}).Info("user logged in successfully")

instead of

log.Info("request %s user %d logged in successfully", user.id, requestId)

Usage

Fetch the package:

go get github.com/Strum355/log

and import it:

import (
    "github.com/Strum355/log"
)

initialize the logger for development:

log.InitSimpleLogger(&log.Config{...})

or for production using a JSON log parser like FluentD

log.InitJSONlogger(&log.Config{...})

# Functions

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

# Constants

Error Levels that can be used to differentiate logged messages and also set the verbosity of logs to display.
Error Levels that can be used to differentiate logged messages and also set the verbosity of logs to display.
Error Levels that can be used to differentiate logged messages and also set the verbosity of logs to display.
Error Levels that can be used to differentiate logged messages and also set the verbosity of logs to display.

# Variables

No description provided by the author

# Structs

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

# Type aliases

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