Documentation ¶
Overview ¶
Package common contains common properties used by the subpackages.
Index ¶
- Constants
- Variables
- func SetLogger(logger Logger)
- func UtcTimeFormat(t time.Time) string
- type ConsoleLogger
- func (l ConsoleLogger) Debug(format string, args ...interface{})
- func (l ConsoleLogger) Error(format string, args ...interface{})
- func (l ConsoleLogger) Info(format string, args ...interface{})
- func (l ConsoleLogger) IsLogLevel(level LogLevel) bool
- func (l ConsoleLogger) Notice(format string, args ...interface{})
- func (l ConsoleLogger) Trace(format string, args ...interface{})
- func (l ConsoleLogger) Warning(format string, args ...interface{})
- type DummyLogger
- func (DummyLogger) Debug(format string, args ...interface{})
- func (DummyLogger) Error(format string, args ...interface{})
- func (DummyLogger) Info(format string, args ...interface{})
- func (DummyLogger) IsLogLevel(level LogLevel) bool
- func (DummyLogger) Notice(format string, args ...interface{})
- func (DummyLogger) Trace(format string, args ...interface{})
- func (DummyLogger) Warning(format string, args ...interface{})
- type LogLevel
- type Logger
- type WriterLogger
- func (l WriterLogger) Debug(format string, args ...interface{})
- func (l WriterLogger) Error(format string, args ...interface{})
- func (l WriterLogger) Info(format string, args ...interface{})
- func (l WriterLogger) IsLogLevel(level LogLevel) bool
- func (l WriterLogger) Notice(format string, args ...interface{})
- func (l WriterLogger) Trace(format string, args ...interface{})
- func (l WriterLogger) Warning(format string, args ...interface{})
Constants ¶
const Version = "3.6.0"
Version holds version information, when bumping this make sure to bump the released at stamp also.
Variables ¶
var ReleasedAt = time.Date(releaseYear, releaseMonth, releaseDay, releaseHour, releaseMin, 0, 0, time.UTC)
Functions ¶
func SetLogger ¶
func SetLogger(logger Logger)
SetLogger sets 'logger' to be used by the unidoc unipdf library.
func UtcTimeFormat ¶
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
LogLevel LogLevel
}
ConsoleLogger is a logger that writes logs to the 'os.Stdout'
func NewConsoleLogger ¶
func NewConsoleLogger(logLevel LogLevel) *ConsoleLogger
NewConsoleLogger creates new console logger.
func (ConsoleLogger) Debug ¶
func (l ConsoleLogger) Debug(format string, args ...interface{})
Debug logs debug message.
func (ConsoleLogger) Error ¶
func (l ConsoleLogger) Error(format string, args ...interface{})
Error logs error message.
func (ConsoleLogger) Info ¶
func (l ConsoleLogger) Info(format string, args ...interface{})
Info logs info message.
func (ConsoleLogger) IsLogLevel ¶
func (l ConsoleLogger) IsLogLevel(level LogLevel) bool
IsLogLevel returns true if log level is greater or equal than `level`. Can be used to avoid resource intensive calls to loggers.
func (ConsoleLogger) Notice ¶
func (l ConsoleLogger) Notice(format string, args ...interface{})
Notice logs notice message.
func (ConsoleLogger) Trace ¶
func (l ConsoleLogger) Trace(format string, args ...interface{})
Trace logs trace message.
func (ConsoleLogger) Warning ¶
func (l ConsoleLogger) Warning(format string, args ...interface{})
Warning logs warning message.
type DummyLogger ¶
type DummyLogger struct{}
DummyLogger does nothing.
func (DummyLogger) Debug ¶
func (DummyLogger) Debug(format string, args ...interface{})
Debug does nothing for dummy logger.
func (DummyLogger) Error ¶
func (DummyLogger) Error(format string, args ...interface{})
Error does nothing for dummy logger.
func (DummyLogger) Info ¶
func (DummyLogger) Info(format string, args ...interface{})
Info does nothing for dummy logger.
func (DummyLogger) IsLogLevel ¶
func (DummyLogger) IsLogLevel(level LogLevel) bool
IsLogLevel returns true from dummy logger.
func (DummyLogger) Notice ¶
func (DummyLogger) Notice(format string, args ...interface{})
Notice does nothing for dummy logger.
func (DummyLogger) Trace ¶
func (DummyLogger) Trace(format string, args ...interface{})
Trace does nothing for dummy logger.
func (DummyLogger) Warning ¶
func (DummyLogger) Warning(format string, args ...interface{})
Warning does nothing for dummy logger.
type Logger ¶
type Logger interface { Error(format string, args ...interface{}) Warning(format string, args ...interface{}) Notice(format string, args ...interface{}) Info(format string, args ...interface{}) Debug(format string, args ...interface{}) Trace(format string, args ...interface{}) IsLogLevel(level LogLevel) bool }
Logger is the interface used for logging in the unipdf package.
var Log Logger = DummyLogger{}
type WriterLogger ¶
WriterLogger is the logger that writes data to the Output writer
func NewWriterLogger ¶
func NewWriterLogger(logLevel LogLevel, writer io.Writer) *WriterLogger
NewWriterLogger creates new 'writer' logger.
func (WriterLogger) Debug ¶
func (l WriterLogger) Debug(format string, args ...interface{})
Debug logs debug message.
func (WriterLogger) Error ¶
func (l WriterLogger) Error(format string, args ...interface{})
Error logs error message.
func (WriterLogger) Info ¶
func (l WriterLogger) Info(format string, args ...interface{})
Info logs info message.
func (WriterLogger) IsLogLevel ¶
func (l WriterLogger) IsLogLevel(level LogLevel) bool
IsLogLevel returns true if log level is greater or equal than `level`. Can be used to avoid resource intensive calls to loggers.
func (WriterLogger) Notice ¶
func (l WriterLogger) Notice(format string, args ...interface{})
Notice logs notice message.
func (WriterLogger) Trace ¶
func (l WriterLogger) Trace(format string, args ...interface{})
Trace logs trace message.
func (WriterLogger) Warning ¶
func (l WriterLogger) Warning(format string, args ...interface{})
Warning logs warning message.