log

package module
v0.0.0-...-3416cdf Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 2 Imported by: 1

README

noxdew/log

A simple log initialisation library for zap

This library is integrated with noxdew/config

Installation

go get bitbucket.org/noxdew/log

Usage

import "bitbucket.org/noxdew/log"

func main() {
    logConfig := log.Config{} // Or parse yaml/json file into it
    logger := logConfig.Create()

    logger.Info(...)
}

Note: the Create method panics on all exceptions. This is to prevent a service/application to run without proper configuration

Contributing

Feel free to create issues or contribute code. We are reviewing them regularly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type      string                 `json:"type" yaml:"type"`
	ZapConfig zapOverwriteableConfig `json:"config" yaml:"config"`
}

Config represents the configuration of the logger

func (Config) Create

func (config Config) Create() *zap.Logger

Create Creates a logger from the config. It will panic on all errors as lack of valid logger configuration will mean the service is running in the dark

Jump to

Keyboard shortcuts

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