logging

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logging provides the application logger. It applies the singleton pattern. To get the logger, use the `Get` function. Child loggers can be created by calling `logger.New`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToAPM

func ToAPM(ctx context.Context, f fields.Fields) fields.Fields

ToAPM adds the required APM fields enabling log correlation.

NOTE: It expects the `apm.Transaction` to be in the context.

Types

type Logger

type Logger struct {
	*sypl.Sypl
}

Logger is the application logger.

func Get

func Get() *Logger

Get returns a setup logger, or set it up. Default level is `ERROR`.

All messages will be directed to StdOut unless in case of ERROR level, which will be directed to StdErr.

NOTE: Use `SYPL_LEVEL` env var to overwrite the max level.

Jump to

Keyboard shortcuts

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