aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/op.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/op.go')
-rw-r--r--system/op.go22
1 files changed, 2 insertions, 20 deletions
diff --git a/system/op.go b/system/op.go
index e252c590..3c334b07 100644
--- a/system/op.go
+++ b/system/op.go
@@ -60,10 +60,6 @@ func TypeString(e Enablement) string {
func New(uid int) (sys *I) {
sys = new(I)
sys.uid = uid
- sys.IsVerbose = func() bool { return false }
- sys.Verbose = func(...any) {}
- sys.Verbosef = func(string, ...any) {}
- sys.WrapErr = func(err error, _ ...any) error { return err }
return
}
@@ -73,27 +69,13 @@ type I struct {
ops []Op
ctx context.Context
- IsVerbose func() bool
- Verbose func(v ...any)
- Verbosef func(format string, v ...any)
- WrapErr func(err error, a ...any) error
-
// whether sys has been reverted
state bool
lock sync.Mutex
}
-func (sys *I) UID() int { return sys.uid }
-func (sys *I) println(v ...any) { sys.Verbose(v...) }
-func (sys *I) printf(format string, v ...any) { sys.Verbosef(format, v...) }
-func (sys *I) wrapErr(err error, a ...any) error { return sys.WrapErr(err, a...) }
-func (sys *I) wrapErrSuffix(err error, a ...any) error {
- if err == nil {
- return nil
- }
- return sys.wrapErr(err, append(a, err)...)
-}
+func (sys *I) UID() int { return sys.uid }
// Equal returns whether all [Op] instances held by v is identical to that of sys.
func (sys *I) Equal(v *I) bool {
@@ -127,7 +109,7 @@ func (sys *I) Commit(ctx context.Context) error {
// sp is set to nil when all ops are applied
if sp != nil {
// rollback partial commit
- sys.printf("commit faulted after %d ops, rolling back partial commit", len(sp.ops))
+ msg.Verbosef("commit faulted after %d ops, rolling back partial commit", len(sp.ops))
if err := sp.Revert(&Criteria{nil}); err != nil {
log.Println("errors returned reverting partial commit:", err)
}