Documentation ¶
Index ¶
- func New() (*Log, *Config)
- type Config
- type DBHandler
- type EmailHandler
- type FileHandler
- type HandlerInterface
- type Level
- type Log
- func (l *Log) Alert(message string, context map[string]interface{})
- func (l *Log) Critical(message string, context map[string]interface{})
- func (l *Log) Debug(message string, context map[string]interface{})
- func (l *Log) Emergency(message string, context map[string]interface{})
- func (l *Log) Error(message string, context map[string]interface{})
- func (l *Log) Info(message string, context map[string]interface{})
- func (l *Log) Notice(message string, context map[string]interface{})
- func (l *Log) Warning(message string, context map[string]interface{})
- type LogInterface
- type PartitionRange
- type RedisHandler
- type TerminalHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { TimeFormat string Handler []HandlerInterface }
func (*Config) AddHandler ¶
func (c *Config) AddHandler(handler HandlerInterface)
type DBHandler ¶
func NewDBHandler ¶
type EmailHandler ¶
func NewEmailHandler ¶
func NewEmailHandler() *EmailHandler
func (*EmailHandler) Write ¶
func (eh *EmailHandler) Write(log Log)
type FileHandler ¶
type FileHandler struct { Partition bool PartitionRange PartitionRange FileName string Path string }
func NewFileHandler ¶
func NewFileHandler() *FileHandler
func (*FileHandler) Write ¶
func (fh *FileHandler) Write(log Log)
type HandlerInterface ¶
type HandlerInterface interface {
Write(log Log)
}
type Level ¶
type Level string
const ALERT Level = "Alert"
const CRITICAL Level = "Critical"
const DEBUG Level = "Debug"
const EMERGENCY Level = "Emergency"
const ERROR Level = "Error"
const INFO Level = "Info"
const NOTICE Level = "Notice"
const WARNING Level = "Warning"
type LogInterface ¶
type LogInterface interface { Debug(message string, context map[string]interface{}) Info(message string, context map[string]interface{}) Notice(message string, context map[string]interface{}) Warning(message string, context map[string]interface{}) Error(message string, context map[string]interface{}) Critical(message string, context map[string]interface{}) Alert(message string, context map[string]interface{}) Emergency(message string, context map[string]interface{}) }
type PartitionRange ¶
type PartitionRange string
const DAILY PartitionRange = "Daily"
const HOURLY PartitionRange = "Hourly"
const MONTHLY PartitionRange = "Monthly"
const YEARLY PartitionRange = "Yearly"
type RedisHandler ¶
type RedisHandler struct { Client *redis.Client Key string }
func NewRedisHandler ¶
func NewRedisHandler() *RedisHandler
func (RedisHandler) Write ¶
func (rh RedisHandler) Write(log Log)
type TerminalHandler ¶
type TerminalHandler struct { }
func NewTerminalHandler ¶
func NewTerminalHandler() *TerminalHandler
func (*TerminalHandler) Write ¶
func (th *TerminalHandler) Write(log Log)
Click to show internal directories.
Click to hide internal directories.