core: Index | Files | Directories

package log

import ""


Package Files

config.pb.go errors.generated.go log.go log_creator.go


var (
    LogType_name = map[int32]string{
        0:  "None",
        1:  "Console",
        2:  "File",
        3:  "Event",
    LogType_value = map[string]int32{
        "None":    0,
        "Console": 1,
        "File":    2,
        "Event":   3,

Enum value maps for LogType.

var File_app_log_config_proto protoreflect.FileDescriptor

func RegisterHandlerCreator Uses

func RegisterHandlerCreator(logType LogType, f HandlerCreator) error

type Config Uses

type Config struct {
    ErrorLogType  LogType      `protobuf:"varint,1,opt,name=error_log_type,json=errorLogType,proto3," json:"error_log_type,omitempty"`
    ErrorLogLevel log.Severity `protobuf:"varint,2,opt,name=error_log_level,json=errorLogLevel,proto3,enum=v2ray.core.common.log.Severity" json:"error_log_level,omitempty"`
    ErrorLogPath  string       `protobuf:"bytes,3,opt,name=error_log_path,json=errorLogPath,proto3" json:"error_log_path,omitempty"`
    AccessLogType LogType      `protobuf:"varint,4,opt,name=access_log_type,json=accessLogType,proto3," json:"access_log_type,omitempty"`
    AccessLogPath string       `protobuf:"bytes,5,opt,name=access_log_path,json=accessLogPath,proto3" json:"access_log_path,omitempty"`
    // contains filtered or unexported fields

func (*Config) Descriptor Uses

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAccessLogPath Uses

func (x *Config) GetAccessLogPath() string

func (*Config) GetAccessLogType Uses

func (x *Config) GetAccessLogType() LogType

func (*Config) GetErrorLogLevel Uses

func (x *Config) GetErrorLogLevel() log.Severity

func (*Config) GetErrorLogPath Uses

func (x *Config) GetErrorLogPath() string

func (*Config) GetErrorLogType Uses

func (x *Config) GetErrorLogType() LogType

func (*Config) ProtoMessage Uses

func (*Config) ProtoMessage()

func (*Config) ProtoReflect Uses

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset Uses

func (x *Config) Reset()

func (*Config) String Uses

func (x *Config) String() string

type HandlerCreator Uses

type HandlerCreator func(LogType, HandlerCreatorOptions) (log.Handler, error)

type HandlerCreatorOptions Uses

type HandlerCreatorOptions struct {
    Path string

type Instance Uses

type Instance struct {
    // contains filtered or unexported fields

Instance is a log.Handler that handles logs.

func New Uses

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

New creates a new log.Instance based on the given config.

func (*Instance) Close Uses

func (g *Instance) Close() error

Close implements common.Closable.Close().

func (*Instance) Handle Uses

func (g *Instance) Handle(msg log.Message)

Handle implements log.Handler.

func (*Instance) Start Uses

func (g *Instance) Start() error

Start implements common.Runnable.Start().

func (*Instance) Type Uses

func (*Instance) Type() interface{}

Type implements common.HasType.

type LogType Uses

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

func (LogType) Descriptor Uses

func (LogType) Descriptor() protoreflect.EnumDescriptor

func (LogType) Enum Uses

func (x LogType) Enum() *LogType

func (LogType) EnumDescriptor Uses

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

Deprecated: Use LogType.Descriptor instead.

func (LogType) Number Uses

func (x LogType) Number() protoreflect.EnumNumber

func (LogType) String Uses

func (x LogType) String() string

func (LogType) Type Uses

func (LogType) Type() protoreflect.EnumType



Package log imports 9 packages (graph) and is imported by 67 packages. Updated 2020-10-15. Refresh now. Tools for package owners.