zlogger

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

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

Go to latest
Published: Oct 16, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMessage

func FormatMessage(msg *zephyr.Message) string

func IsAsciiPrintable

func IsAsciiPrintable(inp string) bool

Types

type Config

type Config struct {
	Logging map[string]Logger
}

Main configuration for the zlogger.

func (*Config) ToQuickMap

func (config *Config) ToQuickMap() QuickMap

func (*Config) ToSubscriptions

func (config *Config) ToSubscriptions() []zephyr.Subscription

func (*Config) Validate

func (config *Config) Validate() error

ValidateConfig makes sure that there are no invalid settings specified. This primarily includes verifying that the logging modes are valid, and that the directories exist.

type Logger

type Logger struct {
	// Class is the zephyr class that is being logged.
	Class string

	// LogDirectory is the location where the zlogs will be placed.
	LogDirectory string

	// Mode specifies how the logs will be sharded. Currently, the
	// following modes are supported:
	//
	// * None - no sharding is performed, all messages will be
	//   logged to the same file. Files will be named with the
	//   class name.
	// * Day - Each day, a new log file will be started. Files
	//   will be named according to the pattern class.YYYY-MM-DD.
	// * Instance - Each instance will result in its own
	//   shard. Files will be named with the instance name.
	//
	// In the event that naming the file would result in special
	// characters (i.e., non-alphanumeric) to appear, the filename
	// "weird" will be chosen instead.
	Mode string
}

func (*Logger) Filename

func (entry *Logger) Filename(msg *zephyr.Message) string

type QuickMap

type QuickMap map[string]*list.List

type ZLogger

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

func NewZLogger

func NewZLogger() *ZLogger

func (*ZLogger) Initialize

func (logger *ZLogger) Initialize(configPath string)

func (*ZLogger) LoadConfiguration

func (logger *ZLogger) LoadConfiguration() error

func (*ZLogger) MessageHandler

func (logger *ZLogger) MessageHandler()

func (*ZLogger) RegisterSignalHandlers

func (logger *ZLogger) RegisterSignalHandlers()

func (*ZLogger) Run

func (logger *ZLogger) Run()

func (*ZLogger) Shutdown

func (logger *ZLogger) Shutdown()

func (*ZLogger) Subscribe

func (logger *ZLogger) Subscribe() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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