예제 #1
0
파일: entry.go 프로젝트: echocat/caretakerd
// 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,
	}
}
예제 #2
0
파일: error.go 프로젝트: echocat/caretakerd
// 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
}