log

package
v0.0.0-...-c3423aa Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package log is the log package for easeprobe.

Index

Constants

View Source
const (
	TCP = "tcp"
	UDP = "udp"
)

Network protocols

View Source
const (
	FileLog = iota
	SysLog
)

Log Type

Variables

This section is empty.

Functions

This section is empty.

Types

type NotifyConfig

type NotifyConfig struct {
	base.DefaultNotify `yaml:",inline"`

	File    string `yaml:"file" json:"file,omitempty" jsonschema:"title=Log File,description=The log file to write the notification message"`
	Host    string `yaml:"host" json:"host,omitempty" jsonschema:"title=Syslog Host,description=The log host to write the notification message"`
	Network string `` /* 156-byte string literal not displayed */
	Type    Type   `yaml:"-" json:"-"`
	// contains filtered or unexported fields
}

NotifyConfig is the configuration of the Notify

func (*NotifyConfig) Config

func (c *NotifyConfig) Config(gConf global.NotifySettings) error

Config configures the log notification

func (*NotifyConfig) ConfigLog

func (c *NotifyConfig) ConfigLog() error

ConfigLog configures the log Unix platform support syslog and log file notification

func (*NotifyConfig) HasNetwork

func (c *NotifyConfig) HasNetwork() bool

HasNetwork returns true if the log has network configuration

func (*NotifyConfig) IsSyslog

func (c *NotifyConfig) IsSyslog() bool

IsSyslog returns true if the log is syslog

func (*NotifyConfig) Log

func (c *NotifyConfig) Log(title, msg string) error

Log logs the message

type SysLogFormatter

type SysLogFormatter struct {
	Type Type `yaml:"-"`
}

SysLogFormatter is log custom format

func (*SysLogFormatter) Format

func (s *SysLogFormatter) Format(entry *log.Entry) ([]byte, error)

Format details

type Type

type Type int

Type is the log type

Jump to

Keyboard shortcuts

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