debug

package
v0.0.0-...-654ee49 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package debug provides functions for debug logging.

Index

Constants

This section is empty.

Variables

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, fmt.Sprintf("%v:debug: ", time.Now()), 0)

Logger logs the debug messages when debug logging is enabled.

Functions

func FlagSet

func FlagSet(name string) bool

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

func NewPrefixLogger

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

func ToJSON(v interface{}) string

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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