OpenDAL has native support for logging.
LoggingLayer will print logs for every operation with the following rules:
- OpenDAL will log in structural way.
- Every operation will start with a started log entry.
- Every operation will finish with the following status:
finished: the operation is successful.
errored: the operation returns an expected error like NotFound.
failed: the operation returns an unexpected error.
Enable logging layer is easy:
use anyhow::Result; use opendal::layers::LoggingLayer; use opendal::Operator; use opendal::Scheme; let _ = Operator::from_env(Scheme::Fs) .expect("must init") .layer(LoggingLayer);
OpenDAL is using
log for logging internally.
To enable logging output, please set
To config logging output, please refer to Configure Logging: