server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Debug int = iota
	Info
	Warning
	State
	Error
	Quiet
)

DebugLevel list

Variables

This section is empty.

Functions

func OpenLogFile

func OpenLogFile(prefix, logDir, logFileName string) (*os.File, error)

OpenLogFile ...

Types

type Logger

type Logger struct {

	// WaitGroup to wait in the callee until channels are stopped
	WaitGroup   sync.WaitGroup
	StatusChan  chan Status
	ErrorChan   chan error
	WarningChan chan string
	LogChan     chan string
	DebugChan   chan string
	DebugLevel  int
	// contains filtered or unexported fields
}

Logger ...

func New

func New() *Logger

New should not be used but returns a minimal valid instance of a ServerLogger

func NewLogger

func NewLogger(serverName string, logDirectory, logFileName string,
	statusChannel chan Status, errorChannel chan error,
	warningChannel chan string, logChannel chan string,
	debugChannel chan string, debugLevel int) *Logger

NewLogger returns a fully configured ServerLogger

func (*Logger) StartLogger

func (l *Logger) StartLogger() error

StartLogger opens a predefined log file, sets a multiwriter with it and runs channels for logging

func (*Logger) StopLogger

func (l *Logger) StopLogger()

StopLogger stops the channels and closes the log files

type Status

type Status int

Status ...

const (
	StateUndefined Status = iota
	StateInitialized
	StateStarting
	StateStarted
	StateRunning
	StateStopping
	StateStopped
	StateError
)

Status list

func (Status) String

func (i Status) String() string

Jump to

Keyboard shortcuts

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