mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-09 16:12:26 +08:00
update vendor & fix upload file url & fix judge file type
This commit is contained in:
12
vendor/github.com/deepzz0/logd/logd.go
generated
vendored
12
vendor/github.com/deepzz0/logd/logd.go
generated
vendored
@@ -67,10 +67,20 @@ type LogOption struct {
|
||||
Mails Emailer // 告警邮件
|
||||
}
|
||||
|
||||
func osSep() string {
|
||||
var sep string
|
||||
if os.IsPathSeparator('\\') {
|
||||
sep = "\\"
|
||||
} else {
|
||||
sep = "/"
|
||||
}
|
||||
return sep
|
||||
}
|
||||
|
||||
// 新建日志打印器
|
||||
func New(option LogOption) *Logger {
|
||||
wd, _ := os.Getwd()
|
||||
index := strings.LastIndex(wd, "/")
|
||||
index := strings.LastIndex(wd, osSep())
|
||||
logger := &Logger{
|
||||
obj: wd[index+1:],
|
||||
out: option.Out,
|
||||
|
||||
Reference in New Issue
Block a user