Skip to content

Commit

Permalink
feat(plc4go): define custom Logger and tracer for bacnet
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Jun 20, 2023
1 parent 9d1877f commit 9bb5a88
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -21,21 +21,24 @@ package main

import (
"fmt"
"github.com/apache/plc4x/plc4go/spi/options"
"os"
"time"

"github.com/apache/plc4x/plc4go/pkg/api"
"github.com/apache/plc4x/plc4go/pkg/api/drivers"
"github.com/apache/plc4x/plc4go/pkg/api/logging"
apiModel "github.com/apache/plc4x/plc4go/pkg/api/model"

"github.com/rs/zerolog/log"
)

func main() {
logging.InfoLevel()
logger := log.With().Str("myCustomLogger", "example").Logger()

driverManager := plc4go.NewPlcDriverManager()
driverManager := plc4go.NewPlcDriverManager(
options.WithCustomLogger(logger),
options.WithTraceTransactionManagerTransactions(true),
)
defer func() {
if err := driverManager.Close(); err != nil {
panic(err)
Expand Down

0 comments on commit 9bb5a88

Please sign in to comment.