aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/report
diff options
context:
space:
mode:
Diffstat (limited to 'internal/report')
-rw-r--r--internal/report/report.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/report/report.go b/internal/report/report.go
index c418c709..0b0427df 100644
--- a/internal/report/report.go
+++ b/internal/report/report.go
@@ -1,3 +1,7 @@
+// Package report implements standard error reporting for system services.
+//
+// It is the responsibility of the caller to arrange for an external
+// service to be notified on error dispatch via [Reporter.Notify].
package report
import (
@@ -56,7 +60,7 @@ func (r *Reporter) SetPathname(a *check.Absolute) { r.pathname.Store(a) }
const (
// DStrict causes all dispatches to end in a call to panic.
DStrict = 1 << iota
- // DNoRecover disallows recovering from error write to persistent storage.
+ // DNoRecover disallows recovering from error writing to persistent storage.
DNoRecover
// DBypassEarly allows persistent storage to be skipped before it is ready.
DBypassEarly
@@ -152,7 +156,9 @@ func (r *Reporter) dispatch(severity int, message string, e error) (err error) {
var w *os.File
r.mu.Lock()
w, err = os.OpenFile(
- a.Append(strconv.FormatUint(uint64(time.Now().UnixNano()), 10)).String(),
+ a.Append(
+ strconv.FormatUint(uint64(time.Now().UnixNano()), 10),
+ ).String(),
os.O_CREATE|os.O_EXCL|os.O_WRONLY,
0400,
)
@@ -181,7 +187,7 @@ func (r *Reporter) dispatch(severity int, message string, e error) (err error) {
return
}
-// Dispatch reports an error and saves it to backing storage if available.
+// Dispatch reports an error and saves it to persistent storage if available.
func (r *Reporter) Dispatch(severity int, message string, e error) {
if err := r.dispatch(severity, message, e); err != nil {
r.getLog().Println(err)