Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Buffer() *bytes.Buffer
- func (l *Logger) EscPos() *Logger
- func (l *Logger) Flags() int
- func (l *Logger) Output(calldepth int, os string) error
- func (l *Logger) Prefix() string
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetPrefix(prefix string)
- func (l *Logger) Writer() io.Writer
- type LoggerService
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 ¶
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 (*Logger) Output ¶
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) 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 ¶
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.
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