log

package
v2.31.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessAccepted = AccessStatus("accepted")
	AccessRejected = AccessStatus("rejected")
)

Variables

View Source
var LogLevel_name = map[int32]string{
	0: "Disabled",
	1: "Error",
	2: "Warning",
	3: "Info",
	4: "Debug",
}
View Source
var LogLevel_value = map[string]int32{
	"Disabled": 0,
	"Error":    1,
	"Warning":  2,
	"Info":     3,
	"Debug":    4,
}
View Source
var LogType_name = map[int32]string{
	0: "None",
	1: "Console",
	2: "File",
	3: "Event",
}
View Source
var LogType_value = map[string]int32{
	"None":    0,
	"Console": 1,
	"File":    2,
	"Event":   3,
}

Functions

func Access

func Access(from, to interface{}, status AccessStatus, reason interface{})

Access writes an access log.

func InitAccessLogger

func InitAccessLogger(file string) error

InitAccessLogger initializes the access logger to write into the give file.

func InitErrorLogger

func InitErrorLogger(file string) error

func SetLogLevel

func SetLogLevel(level LogLevel)

func Trace

func Trace(err error)

Trace logs an error message based on its severity.

Types

type AccessStatus

type AccessStatus string

AccessStatus is the status of an access request from clients.

type Config

type Config struct {
	ErrorLogType  LogType  `protobuf:"varint,1,opt,name=error_log_type,json=errorLogType,enum=v2ray.core.app.log.LogType" json:"error_log_type,omitempty"`
	ErrorLogLevel LogLevel `` /* 129-byte string literal not displayed */
	ErrorLogPath  string   `protobuf:"bytes,3,opt,name=error_log_path,json=errorLogPath" json:"error_log_path,omitempty"`
	AccessLogType LogType  `` /* 128-byte string literal not displayed */
	AccessLogPath string   `protobuf:"bytes,5,opt,name=access_log_path,json=accessLogPath" json:"access_log_path,omitempty"`
}

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetAccessLogPath

func (m *Config) GetAccessLogPath() string

func (*Config) GetAccessLogType

func (m *Config) GetAccessLogType() LogType

func (*Config) GetErrorLogLevel

func (m *Config) GetErrorLogLevel() LogLevel

func (*Config) GetErrorLogPath

func (m *Config) GetErrorLogPath() string

func (*Config) GetErrorLogType

func (m *Config) GetErrorLogType() LogType

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

type Instance

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

func FromSpace

func FromSpace(space app.Space) *Instance

func New

func New(ctx context.Context, config *Config) (*Instance, error)

func (*Instance) Close

func (*Instance) Close()

func (*Instance) Interface

func (*Instance) Interface() interface{}

func (*Instance) Start

func (g *Instance) Start() error

type LogLevel

type LogLevel int32
const (
	LogLevel_Disabled LogLevel = 0
	LogLevel_Error    LogLevel = 1
	LogLevel_Warning  LogLevel = 2
	LogLevel_Info     LogLevel = 3
	LogLevel_Debug    LogLevel = 4
)

func (LogLevel) EnumDescriptor

func (LogLevel) EnumDescriptor() ([]byte, []int)

func (LogLevel) String

func (x LogLevel) String() string

type LogType

type LogType int32
const (
	LogType_None    LogType = 0
	LogType_Console LogType = 1
	LogType_File    LogType = 2
	LogType_Event   LogType = 3
)

func (LogType) EnumDescriptor

func (LogType) EnumDescriptor() ([]byte, []int)

func (LogType) String

func (x LogType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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