Make file append mode observable and persistent

This commit is contained in:
Nanaloveyuki
2026-05-10 12:35:15 +08:00
parent 12730fded8
commit b6673c66e4
8 changed files with 48 additions and 6 deletions
+12
View File
@@ -231,6 +231,14 @@ pub fn RuntimeSink::file_reopen(self : RuntimeSink, append~ : Bool? = None) -> B
}
}
pub fn RuntimeSink::file_append_mode(self : RuntimeSink) -> Bool {
match self {
File(sink) => sink.append_mode()
QueuedFile(sink) => sink.sink.append_mode()
_ => false
}
}
pub fn RuntimeSink::file_flush(self : RuntimeSink) -> Bool {
match self {
File(sink) => sink.flush()
@@ -315,6 +323,10 @@ pub fn ConfiguredLogger::file_reopen(self : ConfiguredLogger, append~ : Bool? =
self.sink.file_reopen(append=append)
}
pub fn ConfiguredLogger::file_append_mode(self : ConfiguredLogger) -> Bool {
self.sink.file_append_mode()
}
pub fn ConfiguredLogger::file_flush(self : ConfiguredLogger) -> Bool {
self.sink.file_flush()
}