@@ -23,7 +23,6 @@ type DashboardCliParam struct {
2323 ConfigFile string // 配置文件路径
2424 DatebaseLocation string // Sqlite3 数据库文件路径
2525 ResetTraffic bool // 重置所有服务器的累计流量数据
26- LogDir string // 日志文件目录
2726}
2827
2928var (
@@ -44,7 +43,6 @@ func init() {
4443 pflag .StringVarP (& dashboardCliParam .ConfigFile , "config" , "c" , "data/config.json" , "配置文件路径" )
4544 pflag .StringVarP (& dashboardCliParam .DatebaseLocation , "db" , "d" , "data/data.db" , "数据库文件路径" )
4645 pflag .BoolVar (& dashboardCliParam .ResetTraffic , "reset-traffic" , false , "重置所有服务器的流量统计" )
47- pflag .StringVar (& dashboardCliParam .LogDir , "logdir" , "logs" , "日志文件目录" )
4846 pflag .Parse ()
4947}
5048
@@ -55,21 +53,6 @@ func main() {
5553 panic (err )
5654 }
5755
58- // 设置日志目录
59- if dashboardCliParam .LogDir != "" {
60- if err := singleton .SetLogDir (dashboardCliParam .LogDir ); err != nil {
61- fmt .Printf ("设置日志目录失败: %v\n " , err )
62- os .Exit (1 )
63- }
64- }
65-
66- // 初始化日志系统
67- if err := singleton .InitLogger (); err != nil {
68- fmt .Printf ("初始化日志系统失败: %v\n " , err )
69- os .Exit (1 )
70- }
71- defer singleton .CloseLogger ()
72-
7356 if dashboardCliParam .Version {
7457 fmt .Println (singleton .Version )
7558 return
0 commit comments