Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncCall ¶ added in v0.0.2
type FuncCall struct {
*FuncLogger
// contains filtered or unexported fields
}
FuncCall holds data needed for a sigle function call tracking and logging.
func (*FuncCall) Debug ¶ added in v0.0.2
Debug return zerolog.Event for writing intermetiate log items between Enter() and Exit().
func (*FuncCall) Error ¶ added in v0.0.2
Error return zerolog.Event for writing intermetiate log items between Enter() and Exit().
func (*FuncCall) Exit ¶ added in v0.0.2
func (fc *FuncCall) Exit()
Exit writes exit message to the log together with execution duration. If silent function call was asked to do flush by calling Flush() before, the input parameters will be written as well.
func (*FuncCall) Info ¶ added in v0.0.2
Info return zerolog.Event for writing intermetiate log items between Enter() and Exit().
type FuncLogger ¶ added in v0.0.2
type FuncLogger struct {
// contains filtered or unexported fields
}
FuncLogger wraps zerolog logger with type/name pair.
func New ¶
func New(l *zerolog.Logger, typ, name string) FuncLogger
New builds new FuncLogger object.
func (*FuncLogger) Enter ¶ added in v0.0.2
func (s *FuncLogger) Enter(params ...interface{}) *FuncCall
Enter builds FuncCall object and writes message "enter" to the log. Log item gets func name and all input parameters.
func (*FuncLogger) EnterSilent ¶ added in v0.0.2
func (s *FuncLogger) EnterSilent(params ...interface{}) *FuncCall
EnterSilent builds FuncCall object but does not write enter message to the log.
func (*FuncLogger) Logger ¶ added in v0.0.2
func (s *FuncLogger) Logger() zerolog.Logger
Logger returns logger instance.