完成日志输出到文件、终端多处的处理

This commit is contained in:
2024-11-13 16:11:59 +08:00
parent 9b643f4352
commit 28291598bb
28 changed files with 175 additions and 330 deletions

View File

@@ -1,13 +1,6 @@
package config
type config struct {
Location string
Point int
Relay string
Mqtt MqttConfig
Aliyun AliyunConfig
Game GameConfig
}
import "gopkg.in/natefinch/lumberjack.v2"
type MqttConfig struct {
Url string
@@ -24,4 +17,19 @@ type GameConfig struct {
MaxTimeout int
}
type Logger struct {
File *lumberjack.Logger
Level string
}
type config struct {
Location string
Point int
Relay string
Log Logger
Mqtt MqttConfig
Aliyun AliyunConfig
Game GameConfig
}
var C config