mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-13 15:12:09 +08:00
【更新】更新pg代码生成
This commit is contained in:
30
pkg/config/log.go
Normal file
30
pkg/config/log.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package config
|
||||
|
||||
import "path"
|
||||
|
||||
type Log struct {
|
||||
Level string `yaml:"level"`
|
||||
File *LogFile `yaml:"file"`
|
||||
}
|
||||
|
||||
type LogFile struct {
|
||||
Name string `yaml:"name"`
|
||||
Path string `yaml:"path"`
|
||||
}
|
||||
|
||||
// 获取完整路径文件名
|
||||
func (l *LogFile) GetFilename() string {
|
||||
var filepath, filename string
|
||||
if fp := l.Path; fp == "" {
|
||||
filepath = "./"
|
||||
} else {
|
||||
filepath = fp
|
||||
}
|
||||
if fn := l.Name; fn == "" {
|
||||
filename = "default.log"
|
||||
} else {
|
||||
filename = fn
|
||||
}
|
||||
|
||||
return path.Join(filepath, filename)
|
||||
}
|
||||
Reference in New Issue
Block a user