logger

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

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
}

ReportLogger used with the Logger package to write logs to the console and a secondary source, usually a printer

func New

func New(title string, flag int, width int, l *log.Logger) *Logger

New creates a new Logger. The out variable sets the destination to which log data will be written. The prefix appears at the beginning of each generated log line. The flag argument defines the logging properties.

func NewReport

func NewReport(title string, l *log.Logger) *Logger

func (*Logger) Buffer

func (l *Logger) Buffer() *bytes.Buffer

func (*Logger) EscPos

func (l *Logger) EscPos() *Logger

func (*Logger) Flags

func (l *Logger) Flags() int

Flags returns the output flags for the logger.

func (*Logger) Output

func (l *Logger) Output(calldepth int, os string) error

Output writes the output for a logging event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is used to recover the PC and is provided for generality, although at the moment on all pre-defined paths it will be 2.

func (*Logger) Prefix

func (l *Logger) Prefix() string

Prefix returns the output prefix for the logger.

func (*Logger) Print

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

Print calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Print.

func (*Logger) Printf

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

Printf calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Println

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

Println calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Println.

func (*Logger) SetFlags

func (l *Logger) SetFlags(flag int)

SetFlags sets the output flags for the logger.

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(prefix string)

SetPrefix sets the output prefix for the logger.

func (*Logger) Writer

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

Writer returns the output destination for the logger.

type LoggerService

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

Kernel service to expose the logger. You can either use the command line arguments or provide the printer definition as an IPP url in the IPP environment variable.

e.g. ipp://host/printers/printer

ipp://user:pass@host/printers/printer

To use tls then use ipps instead of ipp. Yes it's not standard but the service will recognise that it should use TLS.

Also append ?escpos=true if the remote printer is an escpos printer, e.g. a Receipt printer.

e.g. ipp://host/printers/printer?escpos=true

ipp://user:pass@host/printers/printer?escpos=true

func (*LoggerService) Init

func (s *LoggerService) Init(k *kernel.Kernel) error

func (*LoggerService) Name

func (s *LoggerService) Name() string

func (*LoggerService) PostInit

func (s *LoggerService) PostInit() error

func (*LoggerService) Report

func (s *LoggerService) Report(title string, f func(l *Logger) error) error

Jump to

Keyboard shortcuts

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