logger

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 8 Imported by: 2

README

flogg

Logging library for go apis

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLogger

type FileLogger struct {
	DevMode        bool
	LogDir         string
	CurrentLogFile *os.File
	FileLog        *log.Logger
}

func NewLogger

func NewLogger(devMode bool, appDir string) *FileLogger

NewLogger creates a new FileLogger instance.

Parameters:

  • devMode: a boolean indicating whether the logger should output more detailed messages suitable for debugging.
  • appDir: a string representing the subdirectory where log files should be stored. This should be a relative path, and will result in `user_home_dir/[appDir]/logs`.

func (*FileLogger) LogDebug

func (l *FileLogger) LogDebug(message string)

func (*FileLogger) LogError

func (l *FileLogger) LogError(err error)

func (*FileLogger) LogFatal

func (l *FileLogger) LogFatal(err error)

func (*FileLogger) LogInfo

func (l *FileLogger) LogInfo(message string)

func (*FileLogger) LogWarn

func (l *FileLogger) LogWarn(message string)

type Logger

type Logger interface {
	LogFatal(err error)
	LogError(err error)
	LogWarn(message string)
	LogInfo(message string)
	LogDebug(message string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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