Documentation ¶
Index ¶
- type DebugLogger
- func (d *DebugLogger) DecreaseIndentation() (self *DebugLogger)
- func (d *DebugLogger) IncreaseIndentation() (self *DebugLogger)
- func (d *DebugLogger) Indentation() (indentation int)
- func (d *DebugLogger) MethodEnd()
- func (d *DebugLogger) MethodStart(objectName, methodName string, params ...interface{}) (self *DebugLogger)
- func (d *DebugLogger) Println(params ...interface{})
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.