runtimeutil

package
v0.0.0-...-8cba18c Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 9 Imported by: 2

README

go-common/runtimeutil

This repository contains the go-common/runtimeutil library.

To install:

go get github.com/ugorji/go-common/runtimeutil

Package Documentation

Package runtimeutil provides runtime utilities.

Some functions are only available if debugging is enabled. Enable debugging by adding "ugorji=1" to the GODEBUG environmental variable.

Exported Package API

func BytesView(v string) []byte
func Debug() bool
func FileLine(calldepth uint8) (func0, file string, line int)
func FuncFileLine(calldepth uint8) (func0, file string, line int)
func GoroutineID() uint64
func P(pattern string, args ...interface{})
func PkgFuncFileLine(calldepth uint8) (subsystem, func0, file string, line int)
func Stack(bs []byte, all bool) []byte
func StringView(v []byte) string

Documentation

Overview

Package runtimeutil provides runtime utilities.

Some functions are only available if debugging is enabled. Enable debugging by adding "ugorji=1" to the GODEBUG environmental variable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesView

func BytesView(v string) []byte

func Debug

func Debug() bool

func FileLine

func FileLine(calldepth uint8) (func0, file string, line int)

func FuncFileLine

func FuncFileLine(calldepth uint8) (func0, file string, line int)

func GoroutineID

func GoroutineID() uint64

func P

func P(pattern string, args ...interface{})

P printf. the message in red on the terminal. Use it in place of fmt.Printf (which it calls internally).

It also adds diagnostics: package, file, line, func:

func PkgFuncFileLine

func PkgFuncFileLine(calldepth uint8) (subsystem, func0, file string, line int)

pkgFuncFileLine will return the line information.

Examples:

  1. func NewDriver() IN ugorji.net/ndb/driver.go subsystem: ndb file/line: driver.go func0: NewDriver
  2. func (*Ldb) SvrPut IN ugorji.net/ndb/server/leveldb.go subsystem: ndb/server file/line: leveldb.go func0: (*Ldb).SvrPut
  3. func (*Ldb) SvrPut IN github.com/ugorji/go-ndb/ndb/server/leveldb.go subsystem: ugorji/go-ndb/ndb/server file/line: leveldb.go func0: (*Ldb).SvrPut

func Stack

func Stack(bs []byte, all bool) []byte

func StringView

func StringView(v []byte) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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