Skip to content

Commit 52ea469

Browse files
committed
Ensure logger initialises on startup
1 parent 6633e4b commit 52ea469

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/lighthouse/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"crdx.org/lighthouse/db"
1919
"crdx.org/lighthouse/db/repo/settingR"
2020
"crdx.org/lighthouse/pkg/env"
21+
"crdx.org/lighthouse/pkg/logger"
2122
"crdx.org/lighthouse/pkg/util"
2223
"crdx.org/lighthouse/pkg/util/mailutil"
2324
"crdx.org/lighthouse/pkg/util/timeutil"
@@ -69,6 +70,8 @@ func main() {
6970
})
7071
}
7172

73+
logger.Init()
74+
7275
config.InitMiddleware(app, &assets)
7376
config.InitRoutes(app)
7477

pkg/logger/logger.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ var (
1616
mutex sync.Mutex
1717
)
1818

19+
func Init() {
20+
Get()
21+
}
22+
1923
func Get() *slog.Logger {
2024
mutex.Lock()
2125
defer mutex.Unlock()

0 commit comments

Comments
 (0)