logger

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 2 Imported by: 2

README

= Logger
:toc: left

Logger package for private use.

== What is this?

Simple logger package (mainly interface for zap/maybe something else in future) which I use in my own code.

== How to use it?

Here You have primitive snippet

[source,go]
----
package main

import (
	"github.com/a-clap/logger"
	"go.uber.org/zap/zapcore"
)

func main() {
	logger.Init(logger.NewDefaultZap(zapcore.DebugLevel))
	logger.Log.Debug("hello world!")
}
----

You will see colored output in console like:

[source]
----
2022-08-19 21:21:20.955 DEBUG   cmd/main.go:16  hello world!
----



Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultZap

func NewDefaultZap(level zapcore.Level) *zap.SugaredLogger

func NewNop added in v0.0.3

func NewNop() *zap.SugaredLogger

Types

type Logger

type Logger interface {
	Errorf(format string, args ...interface{})
	Error(args ...interface{})

	Fatalf(format string, args ...interface{})
	Fatal(args ...interface{})

	Infof(format string, args ...interface{})
	Info(args ...interface{})

	Warnf(format string, args ...interface{})
	Warn(args ...interface{})

	Debugf(format string, args ...interface{})
	Debug(args ...interface{})
}

Jump to

Keyboard shortcuts

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