debug

package module
v0.0.0-...-d264820 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: MIT Imports: 2 Imported by: 1

README

Debug

Build Status GoDoc Software License

This stable version

Installation

$ go get github.com/mantyr/debug

Example

$ go run ./main.go

$ go run ./main.go --debug=true
package main

import (
    "github.com/mantyr/debug"
    "flag"
)

func init() {
    is_debug := flag.Bool("debug", false, "Debug programs")
    flag.Parse()

    debug.SetDebug(*is_debug)
}

func main() {
    // ...

    val := "123"
    debug.Println("log message", val)          // for log.Println("log message", val)
    debug.Printf("log message %q\r\n", val)    // for log.Printf("log message %q\r\n", val)

    // ...
}

Author

Oleg Shevelev

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteLevel

func DeleteLevel(level string)

No safe. Do not change the values if you do not believe that non-concurrent access

func IsDebug

func IsDebug() bool

func IsLevel

func IsLevel(level string) bool

func LevelPrintf

func LevelPrintf(level string, format string, v ...interface{})

func LevelPrintln

func LevelPrintln(level string, v ...interface{})

func Printf

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

func Println

func Println(v ...interface{})

func SetDebug

func SetDebug(status bool)

No safe. Do not change the values if you do not believe that non-concurrent access

func SetLevel

func SetLevel(levels ...string)

No safe. Do not change the values if you do not believe that non-concurrent access

func SetLevelString

func SetLevelString(levels string)

No safe. Do not change the values if you do not believe that non-concurrent access

Types

This section is empty.

Jump to

Keyboard shortcuts

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