mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-24 00:42:18 +00:00
📝 refine configured file policy docs
This commit is contained in:
@@ -33,9 +33,9 @@ pub fn ConfiguredLogger::file_default_policy(self : ConfiguredLogger) -> FileSin
|
||||
|
||||
Detailed rules explaining key parameters and behaviors
|
||||
|
||||
- File-backed sinks return the default policy captured at creation time.
|
||||
- Queued file sinks forward the default policy from the wrapped file sink.
|
||||
- Non-file sinks return a neutral fallback policy value.
|
||||
- File-backed sinks return the default policy captured at creation time through the wrapped `RuntimeSink`.
|
||||
- Queued file sinks forward the default policy from the wrapped inner file sink.
|
||||
- Non-file sinks return the same neutral fallback policy value produced by `RuntimeSink::file_default_policy()`.
|
||||
- This helper is useful when callers need to compare runtime drift or restore defaults later.
|
||||
|
||||
### How to Use
|
||||
|
||||
@@ -33,8 +33,8 @@ pub fn ConfiguredLogger::file_policy_matches_default(self : ConfiguredLogger) ->
|
||||
|
||||
Detailed rules explaining key parameters and behaviors
|
||||
|
||||
- File-backed sinks compare current runtime file policy against their stored defaults.
|
||||
- Queued file sinks forward the comparison from the wrapped file sink.
|
||||
- File-backed sinks compare current runtime file policy against their stored defaults through the wrapped `RuntimeSink`.
|
||||
- Queued file sinks forward the comparison from the wrapped inner file sink.
|
||||
- Non-file sinks return `false`.
|
||||
- This helper is a compact drift signal when callers do not need to compare full policy objects directly.
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ pub fn ConfiguredLogger::file_policy(self : ConfiguredLogger) -> FileSinkPolicy
|
||||
|
||||
Detailed rules explaining key parameters and behaviors
|
||||
|
||||
- File-backed sinks return their current runtime file policy.
|
||||
- Queued file sinks forward the policy from the wrapped file sink.
|
||||
- Non-file sinks return a neutral fallback policy value.
|
||||
- File-backed sinks return their current runtime file policy through the wrapped `RuntimeSink`.
|
||||
- Queued file sinks forward the policy from the wrapped inner file sink.
|
||||
- Non-file sinks return the same neutral fallback policy value produced by `RuntimeSink::file_policy()`.
|
||||
- This helper is broader than `file_append_mode()` or `file_auto_flush()` because it returns the whole policy object.
|
||||
|
||||
### How to Use
|
||||
|
||||
@@ -33,8 +33,8 @@ pub fn ConfiguredLogger::file_reset_policy(self : ConfiguredLogger) -> Bool {}
|
||||
|
||||
Detailed rules explaining key parameters and behaviors
|
||||
|
||||
- File-backed sinks restore their stored default file policy.
|
||||
- Queued file sinks forward the reset behavior to the wrapped file sink.
|
||||
- File-backed sinks restore their stored default file policy through the wrapped `RuntimeSink`.
|
||||
- Queued file sinks forward the reset behavior to the wrapped inner file sink.
|
||||
- Non-file sinks return `false`.
|
||||
- This helper is the inverse of runtime policy drift, not a generic reopen or flush action.
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ pub fn ConfiguredLogger::file_set_policy(self : ConfiguredLogger, policy : FileS
|
||||
|
||||
Detailed rules explaining key parameters and behaviors
|
||||
|
||||
- File-backed sinks update append, auto-flush, and rotation together.
|
||||
- Queued file sinks forward the policy update to the wrapped file sink.
|
||||
- File-backed sinks update append, auto-flush, and rotation together through the wrapped `RuntimeSink`.
|
||||
- Queued file sinks forward the policy update to the wrapped inner file sink.
|
||||
- Non-file sinks return `false`.
|
||||
- This helper is broader than the single-setting setters because it updates the whole file policy in one call.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user