logger

package module
v0.0.0-...-0e6b5e4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 9 Imported by: 3

README

GoDoc Go Report Card CI

logger


Copyright (c) 2020 Institut National de l'Audiovisuel

Documentation

Overview

Package logger AFAIRE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileOutput

type FileOutput struct {
	*WriterOutput
	// contains filtered or unexported fields
}

FileOutput AFAIRE.

func (*FileOutput) Close

func (fo *FileOutput) Close() error

Close AFAIRE.

type Formatter

type Formatter interface {
	Format(buf *bytes.Buffer, prefix string, level Level, msg string, out Output, ctx ...interface{})
}

Formatter AFAIRE

type Level

type Level int

Level AFAIRE.

const (
	// TraceLevel AFAIRE.
	TraceLevel Level = iota
	// DebugLevel AFAIRE.
	DebugLevel
	// InfoLevel AFAIRE.
	InfoLevel
	// NoticeLevel AFAIRE.
	NoticeLevel
	// WarningLevel AFAIRE.
	WarningLevel
	// ErrorLevel AFAIRE.
	ErrorLevel
	// CriticalLevel AFAIRE.
	CriticalLevel
)

func GetLevelFromString

func GetLevelFromString(level string) Level

GetLevelFromString AFAIRE.

type LogAdapter

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

LogAdapter AFAIRE.

func (*LogAdapter) NewLogger

func (la *LogAdapter) NewLogger(prefix string, flag int) *log.Logger

NewLogger AFAIRE.

func (*LogAdapter) Write

func (la *LogAdapter) Write(p []byte) (int, error)

Write AFAIRE.

type Logger

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

Logger AFAIRE.

func New

func New(prefix, level string, fmt Formatter, out Output) *Logger

New AFAIRE.

func (*Logger) Clone

func (l *Logger) Clone(prefix string) *Logger

Clone AFAIRE.

func (*Logger) Close

func (l *Logger) Close()

Close AFAIRE.

func (*Logger) Critical

func (l *Logger) Critical(msg string, ctx ...interface{})

Critical AFAIRE.

func (*Logger) Debug

func (l *Logger) Debug(msg string, ctx ...interface{})

Debug AFAIRE.

func (*Logger) Error

func (l *Logger) Error(msg string, ctx ...interface{})

Error AFAIRE.

func (*Logger) Info

func (l *Logger) Info(msg string, ctx ...interface{})

Info AFAIRE.

func (*Logger) Log

func (l *Logger) Log(level Level, msg string, ctx ...interface{})

Log AFAIRE.

func (*Logger) NewLogAdapter

func (l *Logger) NewLogAdapter(level string) *LogAdapter

NewLogAdapter AFAIRE.

func (*Logger) Notice

func (l *Logger) Notice(msg string, ctx ...interface{})

Notice AFAIRE.

func (*Logger) Trace

func (l *Logger) Trace(msg string, ctx ...interface{})

Trace AFAIRE.

func (*Logger) Warning

func (l *Logger) Warning(msg string, ctx ...interface{})

Warning AFAIRE.

type Output

type Output interface {
	LogDateTime() bool
	LogLevel() bool
	AddNewLine() bool
	Log(level Level, buf []byte) error
	Close() error
}

Output AFAIRE.

func NewFileOutput

func NewFileOutput(name string) (Output, error)

NewFileOutput AFAIRE.

func NewStderrOutput

func NewStderrOutput() Output

NewStderrOutput AFAIRE.

func NewStdoutOutput

func NewStdoutOutput() Output

NewStdoutOutput AFAIRE.

func NewSyslogOutput

func NewSyslogOutput(facility, app string) (Output, error)

NewSyslogOutput AFAIRE.

type OutputProperties

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

OutputProperties AFAIRE.

func NewOutputProperties

func NewOutputProperties(dateTime, level, newLine bool) *OutputProperties

NewOutputProperties AFAIRE.

func (*OutputProperties) AddNewLine

func (op *OutputProperties) AddNewLine() bool

AddNewLine AFAIRE.

func (*OutputProperties) LogDateTime

func (op *OutputProperties) LogDateTime() bool

LogDateTime AFAIRE.

func (*OutputProperties) LogLevel

func (op *OutputProperties) LogLevel() bool

LogLevel AFAIRE.

type StderrOutput

type StderrOutput struct {
	*WriterOutput
}

StderrOutput AFAIRE.

func (*StderrOutput) Close

func (so *StderrOutput) Close() error

Close AFAIRE.

type StdoutOutput

type StdoutOutput struct {
	*WriterOutput
}

StdoutOutput AFAIRE.

func (*StdoutOutput) Close

func (so *StdoutOutput) Close() error

Close AFAIRE.

type SyslogOutput

type SyslogOutput struct {
	*syslog.Writer
	*OutputProperties
}

SyslogOutput AFAIRE.

func (*SyslogOutput) Log

func (so *SyslogOutput) Log(level Level, buf []byte) error

Log AFAIRE.

type TextFormatter

type TextFormatter struct{}

TextFormatter AFAIRE.

func NewTextFormatter

func NewTextFormatter() *TextFormatter

NewTextFormatter AFAIRE.

func (*TextFormatter) Format

func (tf *TextFormatter) Format(
	buf *bytes.Buffer, prefix string, level Level, msg string, out Output, ctx ...interface{})

Format AFAIRE.

type WriterOutput

type WriterOutput struct {
	io.Writer
	*OutputProperties
}

WriterOutput AFAIRE.

func NewWriterOutput

func NewWriterOutput(iow io.Writer, op *OutputProperties) *WriterOutput

NewWriterOutput AFAIRE.

func (*WriterOutput) Log

func (wo *WriterOutput) Log(_ Level, buf []byte) error

Log AFAIRE.

Jump to

Keyboard shortcuts

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