diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-16 17:26:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-16 18:51:53 +0900 |
| commit | e599b5583dd821ed26bdfc01f7f67d4a317b9843 (patch) | |
| tree | b444a3dc964814360e6779bc10b30f2e599b537c /internal/system/op.go | |
| parent | 33a4ab11c226c736c0d8b2644fbbe27a5ca045e9 (diff) | |
fmsg: implement suspend in writer
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/system/op.go')
| -rw-r--r-- | internal/system/op.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/system/op.go b/internal/system/op.go index 8a98fa78..08b57946 100644 --- a/internal/system/op.go +++ b/internal/system/op.go @@ -3,6 +3,7 @@ package system import ( "context" "errors" + "log" "os" "sync" @@ -105,9 +106,9 @@ func (sys *I) Commit(ctx context.Context) error { // sp is set to nil when all ops are applied if sp != nil { // rollback partial commit - fmsg.VPrintf("commit faulted after %d ops, rolling back partial commit", len(sp.ops)) + fmsg.Verbosef("commit faulted after %d ops, rolling back partial commit", len(sp.ops)) if err := sp.Revert(&Criteria{nil}); err != nil { - fmsg.Println("errors returned reverting partial commit:", err) + log.Println("errors returned reverting partial commit:", err) } } }() |
