企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ package main import ( "flag" "server/conf" "server/game" "server/gate" "server/login" _ "time" _ "FenDZ/glog-master" _ "github.com/dop251/goja" // JS 解析器 "github.com/name5566/leaf" lconf "github.com/name5566/leaf/conf" ) func init() { // 初始化 日志系统 flag.Set("alsologtostderr", "true") // 日志写入文件的同时,输出到stderr flag.Set("log_dir", "./log") // 日志文件保存目录 flag.Set("v", "3") // 配置V输出的等级。 flag.Parse() return } func main() { // 加载配置 lconf.LogLevel = conf.Server.LogLevel lconf.LogPath = conf.Server.LogPath lconf.LogFlag = conf.LogFlag lconf.ConsolePort = conf.Server.ConsolePort lconf.ProfilePath = conf.Server.ProfilePath // 注册模块 leaf.Run( game.Module, gate.Module, login.Module, ) } ~~~