1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-28 21:09:17 +02:00
opentelemetry-go/log/logtest/README.md
Damien Mathieu 8d1d62b905
logtest: Add Recorder (#5134)
* introduce in-memory log exporter

* add changelog entry

* move logtest into a recorder within the api

* rename GetRecords to Result

* rename InMemoryRecorder to Recorder

* name the struct r

* ensure Logger creates a struct copy

* replace severity with enabledFn

* Update CHANGELOG.md

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* kUpdate log/logtest/config.go

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* store all scope records, so we can retrieve everything with `Result()`

* store child loggers instead of all scope records

* no need to explicitly create a new slice

* add concurrent safe test

* handle default enabled function if the struct was manually created

* rename WithEnabledFn to WithEnabledFunc

* test result/reset with child loggers

* add enabled to concurrent safe

* fix lint missing period

* rename defaultEnabledFn to defaultEnabledFunc

* merge recorder.go and config.go

* Update log/logtest/recorder_test.go

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* create empty recorder in concurrent safe test

* Update log/logtest/recorder_test.go

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* fix lint

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update log/logtest/recorder.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* make enabledFunc callable from outside the package

* replace expected with want

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>
2024-04-09 06:45:25 -07:00

146 B

Log Test

PkgGoDev