Skip to content
Snippets Groups Projects
Commit c981fe00 authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

Add support for log level

parent 8c852ca1
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
package main package main
import ( import (
"log/slog"
"time" "time"
"gitlab.imt-atlantique.fr/xaal/code/go/core/uuid" "gitlab.imt-atlantique.fr/xaal/code/go/core/uuid"
...@@ -91,7 +92,7 @@ func (lamp *Lamp) blink(xaal.MessageBody) *xaal.MessageBody { ...@@ -91,7 +92,7 @@ func (lamp *Lamp) blink(xaal.MessageBody) *xaal.MessageBody {
} }
func main() { func main() {
xaal.SetupLogger() xaal.SetupLogger(slog.LevelDebug)
eng := xaal.NewEngine() eng := xaal.NewEngine()
eng.Start() eng.Start()
......
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
package main package main
import ( import (
"log/slog"
"gitlab.imt-atlantique.fr/xaal/code/go/core/uuid" "gitlab.imt-atlantique.fr/xaal/code/go/core/uuid"
"gitlab.imt-atlantique.fr/xaal/code/go/core/xaal" "gitlab.imt-atlantique.fr/xaal/code/go/core/xaal"
) )
func main() { func main() {
xaal.SetupLogger() xaal.SetupLogger(slog.LevelDebug)
eng := xaal.NewEngine() eng := xaal.NewEngine()
lamp := xaal.NewDevice("lamp.dimmer") lamp := xaal.NewDevice("lamp.dimmer")
......
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
package main package main
import ( import (
"log/slog"
"gitlab.imt-atlantique.fr/xaal/code/go/core/schemas" "gitlab.imt-atlantique.fr/xaal/code/go/core/schemas"
"gitlab.imt-atlantique.fr/xaal/code/go/core/uuid" "gitlab.imt-atlantique.fr/xaal/code/go/core/uuid"
"gitlab.imt-atlantique.fr/xaal/code/go/core/xaal" "gitlab.imt-atlantique.fr/xaal/code/go/core/xaal"
) )
func main() { func main() {
xaal.SetupLogger(slog.LevelDebug)
xaal.SetupLogger()
eng := xaal.NewEngine() eng := xaal.NewEngine()
eng.Start() eng.Start()
......
...@@ -2,6 +2,7 @@ package main ...@@ -2,6 +2,7 @@ package main
import ( import (
"fmt" "fmt"
"log/slog"
"gitlab.imt-atlantique.fr/xaal/code/go/core/xaal" "gitlab.imt-atlantique.fr/xaal/code/go/core/xaal"
) )
...@@ -14,7 +15,7 @@ func showMessage(msg *xaal.Message) { ...@@ -14,7 +15,7 @@ func showMessage(msg *xaal.Message) {
} }
func main() { func main() {
xaal.SetupLogger() xaal.SetupLogger(slog.LevelInfo)
eng := xaal.NewEngine() eng := xaal.NewEngine()
eng.Subscribe(showMessage) eng.Subscribe(showMessage)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment