debug

package
v0.1.14-0...-a60c0f6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 6 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, "debug: ", 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