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

Switch go slog

parent 331ec8fe
Branches
No related tags found
No related merge requests found
...@@ -22,8 +22,10 @@ func New${Name}(addr uuid.UUID) *xaal.Device { ...@@ -22,8 +22,10 @@ func New${Name}(addr uuid.UUID) *xaal.Device {
value = 'nil' value = 'nil'
if type_ == 'data = bool': if type_ == 'data = bool':
value = 'false' value = 'false'
elif type_ in ['data = uint','data = number']: elif type_ in ['data = uint',]:
value = 0 value = 0
elif type_ in ['data = number',]:
value = 0.0
elif unit in ['K']: elif unit in ['K']:
value = 0 value = 0
elif unit in ['%','%EL','%RH','°']: elif unit in ['%','%EL','%RH','°']:
...@@ -44,10 +46,10 @@ func New${Name}(addr uuid.UUID) *xaal.Device { ...@@ -44,10 +46,10 @@ func New${Name}(addr uuid.UUID) *xaal.Device {
% if len(keys) != 0 : % if len(keys) != 0 :
${camel_meth} := func(args xaal.MessageBody) *xaal.MessageBody { ${camel_meth} := func(args xaal.MessageBody) *xaal.MessageBody {
// Arguments: ${print_keys} // Arguments: ${print_keys}
log.Printf("${camel_meth} method: ${meth} args: %v\n", args) slog.Info("${camel_meth} method: ${meth}", slog.Any("args",args))
% else: % else:
${camel_meth} := func(xaal.MessageBody) *xaal.MessageBody { ${camel_meth} := func(xaal.MessageBody) *xaal.MessageBody {
log.Printf("${camel_meth} method: ${meth}\n") slog.Info("${camel_meth} method: ${meth}")
% endif % endif
return nil return nil
} }
......
package xaalschemas package schemas
import ( import (
"log" "log/slog"
xaal "xAAL/xaal"
"github.com/google/uuid" "gitlab.imt-atlantique.fr/xaal/code/go/core/uuid"
"gitlab.imt-atlantique.fr/xaal/code/go/core/xaal"
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment