Documentation
¶
Overview ¶
Package debug provides functions for debug logging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Enable bool = FlagSet("debug")
Enable controls whether debug logging is enabled. It is disabled by default.
var Flags = os.Getenv("OPC_DEBUG")
Flags contains the debug flags set by OPC_DEBUG.
- codec : print detailed debugging information when encoding/decoding
var Logger = log.New(os.Stderr, "debug: ", 0)
Logger logs the debug messages when debug logging is enabled.
It defaults to writing to os.Stderr but, since it is an exported *log.Logger, applications can redirect it at runtime with Logger.SetOutput(w) (or replace it entirely, e.g. Logger = log.New(...)), for example to route opcua debug logs through the app's own logging framework. NewPrefixLogger honors the same destination since it derives its writer from Logger.Writer().
Functions ¶
func NewPrefixLogger ¶ added in v0.2.0
PrefixLogger returns a new debug logger when debug logging is enabled. Otherwise, a discarding logger is returned.
Types ¶
This section is empty.