serverlogger

package
v0.0.0-...-aa74118 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 16 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func New

func New(name string) *Logger

New will create a Logger which has an internal log buffer (see the lib/logbuf package). It implements the log.DebugLogger interface. By default, the max debug level is -1, meaning all debug logs are dropped (ignored). The name of the new logger is given by name. This name is used to remotely identify the logger for SRPC methods such as Logger.SetDebugLevel. The first or primary logger should be created with name "" (the empty string).

func NewWithFlags

func NewWithFlags(name string, flags int) *Logger

NewWithFlags will create a Logger which has an internal log buffer (see the lib/logbuf package). It implements the log.DebugLogger interface. By default, the max debug level is -1, meaning all debug logs are dropped (ignored). The name of the new logger is given by name. This name is used to remotely identify the logger for RPC methods such as Logger.SetDebugLevel. The first or primary logger should be created with name "" (the empty string).

func NewWithOptions

func NewWithOptions(name string, options logbuf.Options, flags int) *Logger

NewWithOptions will create a Logger which has an internal log buffer (see the lib/logbuf package). It implements the log.DebugLogger interface. By default, the max debug level is -1, meaning all debug logs are dropped (ignored). The name of the new logger is given by name. This name is used to remotely identify the logger for RPC methods such as Logger.SetDebugLevel. The first or primary logger should be created with name "" (the empty string).

func (*Logger) Debug

func (l *Logger) Debug(level uint8, v ...interface{})

Debug will call the Print method if level is less than or equal to the max debug level for the Logger.

func (*Logger) Debugf

func (l *Logger) Debugf(level uint8, format string, v ...interface{})

Debugf will call the Printf method if level is less than or equal to the max debug level for the Logger.

func (*Logger) Debugln

func (l *Logger) Debugln(level uint8, v ...interface{})

Debugln will call the Println method if level is less than or equal to the max debug level for the Logger.

func (*Logger) Fatal

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

Fatal is equivalent to Print() followed by a call to os.Exit(1).

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, v ...interface{})

Fatalf is equivalent to Printf() followed by a call to os.Exit(1).

func (*Logger) Fatalln

func (l *Logger) Fatalln(v ...interface{})

Fatalln is equivalent to Println() followed by a call to os.Exit(1).

func (*Logger) Flush

func (l *Logger) Flush() error

Flush flushes the open log file (if one is open). This should only be called just prior to process termination. The log file is automatically flushed after short periods of inactivity.

func (*Logger) GetLevel

func (l *Logger) GetLevel() int16

GetLevel gets the current maximum debug level.

func (*Logger) Panic

func (l *Logger) Panic(v ...interface{})

Panic is equivalent to Print() followed by a call to panic().

func (*Logger) Panicf

func (l *Logger) Panicf(format string, v ...interface{})

Panicf is equivalent to Printf() followed by a call to panic().

func (*Logger) Panicln

func (l *Logger) Panicln(v ...interface{})

Panicln is equivalent to Println() followed by a call to panic().

func (*Logger) Print

func (l *Logger) Print(v ...interface{})

Print prints to the logger. Arguments are handled in the manner of fmt.Print.

func (*Logger) Printf

func (l *Logger) Printf(format string, v ...interface{})

Printf prints to the logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Println

func (l *Logger) Println(v ...interface{})

Println prints to the logger. Arguments are handled in the manner of fmt.Println.

func (*Logger) SetAccessChecker

func (l *Logger) SetAccessChecker(
	accessChecker func(method string, authInfo *srpc.AuthInformation) bool)

SetAccessChecker sets the function that is called when SRPC methods are called for the Logger. This allows the application to control which users or groups are permitted to remotely control the Logger.

func (*Logger) SetLevel

func (l *Logger) SetLevel(maxLevel int16)

SetLevel sets the maximum debug level. A negative level will cause all debug messages to be dropped.

func (*Logger) WriteHtml

func (l *Logger) WriteHtml(writer io.Writer)

WriteHtml will write the contents of the internal log buffer to writer, with appropriate HTML markups.

Jump to

Keyboard shortcuts

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