Xuanwo opened a new pull request, #8910:
URL: https://github.com/apache/opendal/pull/8910

   # Which issue does this PR close?
   
   None. Found during maintenance; no separate issue was filed.
   
   # Rationale for this change
   
   `opendal-layer-logging` had two logging defects:
   
   1. `DefaultLoggingInterceptor::log` emitted a `Warn` or `Error` log inside 
`if let Some(err) = err`, then fell through into the trailing `Debug` `log!` 
call. Whenever `Debug` logging was enabled, every failed operation emitted a 
duplicate `Debug` record without error details immediately after the 
`Warn`/`Error` record.
   2. `LoggingCopier::close` forwarded `self.inner.close().await` directly 
without emitting any log record, unlike `LoggingWriter::close` and 
`LoggingComposer::close` (and `LoggingCopier::abort`), leaving server-side copy 
completion outcomes and errors unlogged.
   
   # What changes are included in this PR?
   
   - Wrap the trailing `Level::Debug` `log!` in 
`DefaultLoggingInterceptor::log` in an `else` branch so error events emit only 
the single `Warn`/`Error` record while non-error events continue logging at 
`Debug`.
   - Log `close succeeded` and `close failed` in `LoggingCopier::close` with 
`Operation::Copy` and `from`/`to`/`copied` context, matching 
`LoggingWriter::close`, `LoggingComposer::close`, and `LoggingCopier::abort`.
   - Add unit regression tests covering expected and unexpected error logging 
at `Debug` level (and non-error `Debug` logging) via 
`DefaultLoggingInterceptor`, as well as `LoggingCopier::close` success and 
failure logging.
   
   # Are there any user-facing changes?
   
   Users enabling `Debug` logging with `LoggingLayer::default()` will no longer 
see duplicate `Debug` failure records after `Warn`/`Error` logs, and 
`LoggingLayer` now logs `copy close succeeded` / `copy close failed` events.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: pi
   - Model: Gemini 4 Neon
   - Effort: high
   - Role: Verified both defects in `core/layers/logging`, implemented the 
fixes and unit regression tests, and opened this pull request.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to