debuglogger

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugLogger

type DebugLogger struct {
	// contains filtered or unexported fields
}

DebugLogger is a logger that supports log outputs with indentation to reflect the structure and hierarchical nature of executed functions and code blocks.

func New

func New(identifier string) (newDebugLogger *DebugLogger)

New creates a new DebugLogger instance with the given identifier.

func (*DebugLogger) DecreaseIndentation

func (d *DebugLogger) DecreaseIndentation() (self *DebugLogger)

DecreaseIndentation decreases the indentation of the DebugLogger.

func (*DebugLogger) IncreaseIndentation

func (d *DebugLogger) IncreaseIndentation() (self *DebugLogger)

IncreaseIndentation increases the indentation of the DebugLogger.

func (*DebugLogger) Indentation

func (d *DebugLogger) Indentation() (indentation int)

Indentation returns the current indentation of the DebugLogger.

func (*DebugLogger) MethodEnd

func (d *DebugLogger) MethodEnd()

MethodEnd logs the end of the method (closing curly braces) and decreases the indentation by 1 level.

func (*DebugLogger) MethodStart

func (d *DebugLogger) MethodStart(objectName, methodName string, params ...interface{}) (self *DebugLogger)

MethodStart logs a method call and indents the following log outputs. The indentation is reverted after a call of MethodEnd.

Usage: defer logger.MethodStart("myObject", "myMethod", param1, param2).MethodEnd() // at beginning of the method.

func (*DebugLogger) Println

func (d *DebugLogger) Println(params ...interface{})

Println logs a message to the console.

Jump to

Keyboard shortcuts

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