tiologger

package module
v0.0.0-...-055c9eb Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 5 Imported by: 0

README

drawing

tiologger

taxed.io

GitHub go.mod Go version (branch) GitHub GitLab Release (custom instance) Gitlab pipeline status Gitlab code coverage GitHub contributors

Go Report Card

Introduction

This package creates a basic logging service.

Basic Example

package app

import (
	"github.com/gin-gonic/gin"
	"gitlab.com/taxedio/tiologger"
)

var (
	Router = gin.Default()
	EnvLoc = ".env"
)

func StartApplication() {
	Router = MapUrls(Router)
	logger.Info("about to start the application...")
	if err := Router.Run(); err != nil {
		logger.Critical("application.go error running router", err)
		panic(err)
	}
}

console:

{"level":"info","time":"2022-04-07T12:12:38.079+0100","msg":"about to start the application..."}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(msg string, err error, tags ...zap.Field)

Critical, creates log entry under "CRITICAL". Requires string and error

func DPanic

func DPanic(msg string, err error, tags ...zap.Field)

DPanic, creates log entry under "D-PANIC". Requires string and error

func Debug

func Debug(msg string, tags ...zap.Field)

Debug, creates log entry under "debug". Requires string

func Error

func Error(msg string, err error, tags ...zap.Field)

Error, creates log entry under "ERROR". Requires string and error

func GetLogger

func GetLogger() tioLogger

GetLogger, returns *zap.Logger

func Info

func Info(msg string, tags ...zap.Field)

Info, creates log entry under "info". Requires string

func Panic

func Panic(msg string, err error, tags ...zap.Field)

Panic, creates log entry under "PANIC". Requires string and error

func Warn

func Warn(msg string, tags ...zap.Field)

Info, creates log entry under "info". Requires string

Types

This section is empty.

Jump to

Keyboard shortcuts

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