services

package
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFileMeta

type LogFileMeta struct {
	Lock           sync.Mutex
	VerbosityLevel int
	LogFile        string
	FileLimitInKB  int
	// contains filtered or unexported fields
}

LogFileMeta provides required methods to create and maintain dynamic log files

func CreateNewLogFile

func CreateNewLogFile(dir, serviceName string, truncateDataOnLog bool) (*LogFileMeta, error)

CreateNewLogFile creates a file inside given log location

func (*LogFileMeta) Write

func (w *LogFileMeta) Write(message string)

Write writes the given message param to the log file pointed by the logFileMeta Struct

type LoggerIface

type LoggerIface interface {
	Log(logLevel enums.VerbosityLevel, message string) error
	SetLogLevel(logLevel enums.VerbosityLevel)
}

LoggerIface exposes the log package defintions to other modules

type LoggerService

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

LoggerService implementsthe Ilogger.go service

func NewLoggerService

func NewLoggerService(userName *string, serviceName *string, logLocationBaseDir *string) *LoggerService

NewLoggerService is the constructor for LoggerService Struct the default verbose level is 3

func (*LoggerService) Log

func (lwService *LoggerService) Log(logLevel enums.VerbosityLevel, message string) error

Log method logs the data onto the local file

func (*LoggerService) SetLogLevel added in v1.0.7

func (lwService *LoggerService) SetLogLevel(logLevel enums.VerbosityLevel)

SetLogLevel sets the custom level apart from default

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL