logger

package
v0.0.0-...-b2b82d6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 3 Imported by: 2

README

Extended *log.Logger lib

Import the library

import (
    ml "github.com/tomekwlod/utils/logger"
)

Simple usage

func main() {
    multi := io.MultiWriter(file, os.Stdout)

    l := ml.New(
        os.Getenv("LOGGING_MODE"),
        log.New(multi, "", log.Ldate|log.Ltime|log.Lshortfile),
    )

    l.Debugln("Debug message")
    l.Println("Info")
}

Todo

So far there are only three additional methods to print out the debug. Later I may implement more levels, but for the most cases the debug is really enough.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*log.Logger
	// contains filtered or unexported fields
}

func New

func New(level string, logger *log.Logger) *Logger

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

func (*Logger) Debugln

func (l *Logger) Debugln(v ...interface{})

Jump to

Keyboard shortcuts

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