Skip to content

Commit 9569b0f

Browse files
authored
docs: Add few more notes about Logs design doc (#2816)
1 parent 2070e6c commit 9569b0f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/design/logs.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ They get called in the order of registration. Log records are passed to the
195195
records, enrich them, filter them, and export to destinations by leveraging
196196
LogRecord Exporters.
197197

198+
Similar to [LoggerProvider](#sdkloggerprovider), methods on the `LogProcessor`
199+
trait also takes a immutable self (`&self`) only, forcing the need to use
200+
interior mutability, if any mutation is required. The exception to this is
201+
`set_resource`, which takes a `&mut self`. This is acceptable as `set_resource`
202+
is called by the `SdkLoggerProvider` during build() method only, and is not
203+
required after that.
204+
198205
Following built-in Log processors are provided in the Log SDK:
199206

200207
##### SimpleLogProcessor
@@ -232,8 +239,13 @@ other words, that many logs can be lost if the app crashes in the middle.
232239

233240
## LogExporters
234241

235-
LogExporters are responsible for exporting logs to a destination. Some of them
236-
include:
242+
LogExporters are responsible for exporting logs to a destination.
243+
`SdkLoggerProvider` does not have a direct knowledge of the `LogExporter`, as it
244+
only deals with `LogProcessors`. It is the `LogProcessor`s that invokes
245+
`LogExporter` methods. Most methods on `LogExporter` trait also only takes
246+
`&self`, following the same reasoning as [LogProcessors](#logrecord-processors)
247+
248+
Some of the exporters are:
237249

238250
1. **InMemoryExporter** - exports to an in-memory list, primarily for
239251
unit-testing. This is used extensively in the repo itself, and external users

0 commit comments

Comments
 (0)