mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
✨ Add bundled file policy setters
This commit is contained in:
@@ -388,6 +388,20 @@ pub fn RuntimeSink::file_set_auto_flush(self : RuntimeSink, enabled : Bool) -> B
|
||||
}
|
||||
}
|
||||
|
||||
pub fn RuntimeSink::file_set_policy(self : RuntimeSink, policy : FileSinkPolicy) -> Bool {
|
||||
match self {
|
||||
File(sink) => {
|
||||
sink.set_policy(policy)
|
||||
true
|
||||
}
|
||||
QueuedFile(sink) => {
|
||||
sink.sink.set_policy(policy)
|
||||
true
|
||||
}
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn RuntimeSink::file_set_rotation(self : RuntimeSink, rotation : FileRotation?) -> Bool {
|
||||
match self {
|
||||
File(sink) => {
|
||||
@@ -617,6 +631,10 @@ pub fn ConfiguredLogger::file_set_auto_flush(self : ConfiguredLogger, enabled :
|
||||
self.sink.file_set_auto_flush(enabled)
|
||||
}
|
||||
|
||||
pub fn ConfiguredLogger::file_set_policy(self : ConfiguredLogger, policy : FileSinkPolicy) -> Bool {
|
||||
self.sink.file_set_policy(policy)
|
||||
}
|
||||
|
||||
pub fn ConfiguredLogger::file_set_rotation(
|
||||
self : ConfiguredLogger,
|
||||
rotation : FileRotation?,
|
||||
|
||||
Reference in New Issue
Block a user