logger

package module
v2.0.0-...-7e0ce01 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

common-logger

Provides a consistent logger across projects. This is a very thin wrapper for Uber's Zap.

It just provides two profiles which work for my projects - console and server. console is easily read on the CLI, whereas server provides json formatted logs suitable for use with GKE Stackdriver logging

Usage:

package main

import (
    log "github.com/crispibits/common-logger"
)

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

The logging can then be changed by running:

PROFILE=console go run main.go

Documentation

Index

Constants

View Source
const ENV_PROFILE string = "PROFILE"

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.SugaredLogger
}

func New

func New(opts ...zap.Option) *Logger

Jump to

Keyboard shortcuts

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