mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
517 B
33 lines
517 B
package internal
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"v2ray.com/core/common/serial"
|
|
)
|
|
|
|
type LogEntry interface {
|
|
fmt.Stringer
|
|
}
|
|
|
|
type ErrorLog struct {
|
|
Prefix string
|
|
Error error
|
|
}
|
|
|
|
func (l *ErrorLog) String() string {
|
|
return l.Prefix + l.Error.Error()
|
|
}
|
|
|
|
type AccessLog struct {
|
|
From interface{}
|
|
To interface{}
|
|
Status string
|
|
Reason interface{}
|
|
}
|
|
|
|
func (l *AccessLog) String() string {
|
|
return strings.Join([]string{serial.ToString(l.From), l.Status, serial.ToString(l.To), serial.ToString(l.Reason)}, " ")
|
|
}
|