log

package
v0.0.0-...-4dd6cf4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package log is used to print logs based of log types

Index

Constants

View Source
const (
	//INFO is for informative logs
	INFO = "INFO"
	//DEBUG is for debugging the app
	DEBUG = "DEBUG"
	//WARN is for warning signatures
	WARN = "WARN"
	//ERROR is for errors
	ERROR = "ERROR"
	//PANIC is for panic log prefix
	PANIC = "PANIC"
)

Log types for logger

Variables

This section is empty.

Functions

func Debug

func Debug(l ...interface{})

Debug logs the debug logs of the application if debug logs are not switched off

func Error

func Error(l ...interface{})

Error logs the error logs of the application

func Fatal

func Fatal(l ...interface{})

Fatal is used to print logs for events which causes the app to exit

func Info

func Info(l ...interface{})

Info logs the info logs of the application

func Warn

func Warn(l ...interface{})

Warn logs the warning logs of the application

Types

type Logger

type Logger struct {
	//ID of the logger
	ID int
}

Logger must be implemented by the logger utilities to be an app logger

func NewLogger

func NewLogger(ID int) *Logger

NewLogger returns the new logger with ID initiated

func (*Logger) Debug

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

Debug logs for the debugging logs

func (*Logger) Error

func (lo *Logger) Error(l ...interface{})

Error logs the error

func (*Logger) Fatal

func (lo *Logger) Fatal(l ...interface{})

Fatal logs the fatal issues

func (*Logger) GetID

func (lo *Logger) GetID() int

GetID returns the id of the logger

func (*Logger) Info

func (lo *Logger) Info(l ...interface{})

Info logs the informative logs

func (*Logger) Warn

func (lo *Logger) Warn(l ...interface{})

Warn logs the warning logs

Jump to

Keyboard shortcuts

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