20 lines
470 B
Go
20 lines
470 B
Go
package log
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
// E wraps an error with scope and message.
|
|
func E(scope, message string, err error) error {
|
|
if err == nil {
|
|
return errors.New(scope + ": " + message)
|
|
}
|
|
return fmt.Errorf("%s: %s: %w", scope, message, err)
|
|
}
|
|
|
|
// Error writes an error-level message. This stub is a no-op for tests.
|
|
func Error(msg string, _ ...any) {}
|
|
|
|
// Info writes an info-level message. This stub is a no-op for tests.
|
|
func Info(msg string, _ ...any) {}
|