debuglogger

package
v0.0.0-...-25ef478 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

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