feat: add startup logging with network IPs and container detection

This commit is contained in:
CaIon
2025-09-27 16:19:58 +08:00
parent 5197d874d7
commit 476cf10495
3 changed files with 113 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ import (
"one-api/setting/ratio_setting"
"os"
"strconv"
"time"
"github.com/bytedance/gopkg/util/gopool"
"github.com/gin-contrib/sessions"
@@ -33,6 +34,7 @@ var buildFS embed.FS
var indexPage []byte
func main() {
startTime := time.Now()
err := InitResources()
if err != nil {
@@ -150,6 +152,10 @@ func main() {
if port == "" {
port = strconv.Itoa(*common.Port)
}
// Log startup success message
common.LogStartupSuccess(startTime, port)
err = server.Run(":" + port)
if err != nil {
common.FatalLog("failed to start HTTP server: " + err.Error())
@@ -204,4 +210,4 @@ func InitResources() error {
return err
}
return nil
}
}