magro

package module
v0.0.0-...-400ca95 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: MIT Imports: 3 Imported by: 1

README

magro

Go Tracing library parody of C MACRO __LINE__, __FUNCTION__, __FILE__.

Example

import (
    ...
    m "github.com/Napat/magro"
)

func example() {
    fmt.Printf("File fullpath: %s\n", m.FileFullpath())
    fmt.Printf("File: %s\n", m.File())
    fmt.Printf("Function: %s\n", m.Function())
    fmt.Printf("Line: %d\n", m.Line())
    fmt.Printf("Where: %s\n", m.Where())
    fmt.Printf("Info: %s\n", m.Info())
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(depthList ...int) string

File return a string containing the filename of the call stack

func FileFullpath

func FileFullpath(depthList ...int) string

FileFullpath return a string containing the filename(fullpath) of the call stack

func Function

func Function(depthList ...int) string

Function return a string containing the function name of the call stack

func Info

func Info(depthList ...int) (filename string, funcName string, line int)

Info return a file name, function name and the line number of the call stack

func Line

func Line(depthList ...int) int

Line return a line number of the call stack

func Where

func Where(depthList ...int) string

Where return a string information containing the file name, function name and the line number of the call stack

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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