1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-20 04:04:15 -04:00
v2fly/app/log/internal/log_entry.go
Darien Raymond 59a1e2d736
refactor
2017-04-23 19:16:56 +02:00

33 lines
517 B
Go

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)}, " ")
}