Version: v0.5.1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 7 Imported by: 64



Package debug provides functions for debug logging.



This section is empty.


View Source
var Enable bool = FlagSet("debug")

Enable controls whether debug logging is enabled. It is disabled by default.

View Source
var Flags = os.Getenv("OPC_DEBUG")

Flags contains the debug flags set by OPC_DEBUG.

  • codec : print detailed debugging information when encoding/decoding
View Source
var Logger = log.New(os.Stderr, "debug: ", 0)

Logger logs the debug messages when debug logging is enabled.


func FlagSet

func FlagSet(name string) bool

FlagSet returns true if the OPCUA_DEBUG environment variable contains the given flag.

func NewPrefixLogger added in v0.2.0

func NewPrefixLogger(format string, args ...interface{}) *log.Logger

PrefixLogger returns a new debug logger when debug logging is enabled. Otherwise, a discarding logger is returned.

func Printf

func Printf(format string, args ...interface{})

Printf logs the message with Logger.Printf() when debug logging is enabled.

func ToJSON added in v0.2.0

func ToJSON(v interface{}) string

ToJSON returns the JSON representation of v when debug logging is enabled.


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL