gologger

package module
v0.0.0-...-ea6671b Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

Important Notice

This public repository is read-only and no longer maintained.

CLA assistant GoDoc Travis Build

Go Logger

Simple logger for Go.

License

This project is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.

User Guide

Use the following command to download the logger.

go get github.com/SAP/gologger

By default the logger is configured to output to default standard output file. This behavior could be changed by creating an instance of the logger and passing a different output. The logger provide methods for writing 5 different types of messages to the configured output.

Print debug message "Hello world, Jon Snow" to standard output.

gologger.Debugf("Hello world, %s!", "Jon Snow")

Print info message "Hello world, Jon Snow" to standard output.

gologger.Infof("Hello world, %s!", "Jon Snow")

Print warning message "Hello world, Jon Snow" to standard output.

gologger.Warnf("Hello world, %s!", "Jon Snow")

Print error message "Hello world, Jon Snow" to standard output.

gologger.Errorf("Hello world, %s!", "Jon Snow")

Print fatal message "Hello world, Jon Snow" to standard output and exit program.

gologger.Fatalf("Hello world, %s!", "Jon Snow")

Tests

gologger project contains unit tests, in order to execute them run the following command in project root directory.

ginkgo -r

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(message string, args ...interface{})

func Errorf

func Errorf(message string, args ...interface{})

func Fatalf

func Fatalf(message string, args ...interface{})

func Infof

func Infof(message string, args ...interface{})

func Warnf

func Warnf(message string, args ...interface{})

Types

type Logger

type Logger interface {
	Debugf(message string, args ...interface{})
	Infof(message string, args ...interface{})
	Warnf(message string, args ...interface{})
	Errorf(message string, args ...interface{})
	Fatalf(message string, args ...interface{})
}
var DefaultLogger Logger = NewNativeLogger(os.Stdout, os.Stderr)

type NativeLogger

type NativeLogger struct {
	// contains filtered or unexported fields
}

func NewNativeLogger

func NewNativeLogger(out, err io.Writer) *NativeLogger

func (*NativeLogger) Debugf

func (l *NativeLogger) Debugf(message string, args ...interface{})

func (*NativeLogger) Errorf

func (l *NativeLogger) Errorf(message string, args ...interface{})

func (*NativeLogger) Fatalf

func (l *NativeLogger) Fatalf(message string, args ...interface{})

func (*NativeLogger) Infof

func (l *NativeLogger) Infof(message string, args ...interface{})

func (*NativeLogger) Warnf

func (l *NativeLogger) Warnf(message string, args ...interface{})

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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