12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- package tracelog
- import (
- "fmt"
- )
- func Started(title string, functionName string) {
- logger.Trace.Output(2, fmt.Sprintf("%s : %s : Started\n", title, functionName))
- }
- func Startedf(title string, functionName string, format string, a ...interface{}) {
- logger.Trace.Output(2, fmt.Sprintf("%s : %s : Started : %s\n", title, functionName, fmt.Sprintf(format, a...)))
- }
- func Completed(title string, functionName string) {
- logger.Trace.Output(2, fmt.Sprintf("%s : %s : Completed\n", title, functionName))
- }
- func Completedf(title string, functionName string, format string, a ...interface{}) {
- logger.Trace.Output(2, fmt.Sprintf("%s : %s : Completed : %s\n", title, functionName, fmt.Sprintf(format, a...)))
- }
- func CompletedError(err error, title string, functionName string) {
- logger.Error.Output(2, fmt.Sprintf("%s : %s : Completed : ERROR : %s\n", title, functionName, err))
- }
- func CompletedErrorf(err error, title string, functionName string, format string, a ...interface{}) {
- logger.Error.Output(2, fmt.Sprintf("%s : %s : Completed : ERROR : %s : %s\n", title, functionName, fmt.Sprintf(format, a...), err))
- }
- func Trace(title string, functionName string, format string, a ...interface{}) {
- logger.Trace.Output(2, fmt.Sprintf("%s : %s : Info : %s\n", title, functionName, fmt.Sprintf(format, a...)))
- }
- func Info(title string, functionName string, format string, a ...interface{}) {
- logger.Info.Output(2, fmt.Sprintf("%s : %s : Info : %s\n", title, functionName, fmt.Sprintf(format, a...)))
- }
- func Warning(title string, functionName string, format string, a ...interface{}) {
- logger.Warning.Output(2, fmt.Sprintf("%s : %s : Info : %s\n", title, functionName, fmt.Sprintf(format, a...)))
- }
- func Error(err error, title string, functionName string) {
- logger.Error.Output(2, fmt.Sprintf("%s : %s : ERROR : %s\n", title, functionName, err))
- }
- func Errorf(err error, title string, functionName string, format string, a ...interface{}) {
- logger.Error.Output(2, fmt.Sprintf("%s : %s : ERROR : %s : %s\n", title, functionName, fmt.Sprintf(format, a...), err))
- }
- func Alert(subject string, title string, functionName string, format string, a ...interface{}) {
- message := fmt.Sprintf("%s : %s : ALERT : %s\n", title, functionName, fmt.Sprintf(format, a...))
- logger.Error.Output(2, message)
- SendEmailException(subject, message)
- }
- func CompletedAlert(subject string, title string, functionName string, format string, a ...interface{}) {
- message := fmt.Sprintf("%s : %s : Completed : ALERT : %s\n", title, functionName, fmt.Sprintf(format, a...))
- logger.Error.Output(2, message)
- SendEmailException(subject, message)
- }
|