Beispiel #1
0
// NewEntry creates a new instance of Entry.
func NewEntry(framesToSkip int, problem interface{}, category string, prioriy Level, time time.Time, message string, uptime time.Duration) Entry {
	return Entry{
		Time:     time,
		Message:  message,
		Priority: prioriy,
		Category: category,
		Stack:    stack.CaptureStack(framesToSkip + 1),
		Uptime:   uptime,
		Problem:  problem,
	}
}
Beispiel #2
0
// New creates a new instance of Error.
func New(message string, a ...interface{}) Error {
	var targetMessage string
	if len(a) == 0 {
		targetMessage = message
	} else {
		targetMessage = fmt.Sprintf(message, a...)
	}
	result := Error{
		message: targetMessage,
		stack:   stack.CaptureStack(1),
	}
	return result
}