forgejo/modules/log
limiting-factor 2d2029c598 tests: make buffer log writer thread safe (#11962)
When two goroutines attempt to access the content of the buffer log writer, they must be made thread safe with a write mutex.

The buffer log writer is only used in testing.

## Checklist

### Tests for Go changes

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I ran...
  - [ ] `make pr-go` before pushing

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change.
- [x] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change.

*The decision if the pull request will be shown in the release notes is up to the mergers / release team.*

The content of the `release-notes/<pull request number>.md` file will serve as the basis for the release notes. If the file does not exist, the title of the pull request will be used instead.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11962
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: limiting-factor <limiting-factor@posteo.com>
Co-committed-by: limiting-factor <limiting-factor@posteo.com>
2026-04-04 16:29:14 +02:00
..
color.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
color_console.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
color_console_other.go chore: handle error types consistently (#9873) 2026-03-06 00:48:06 +01:00
color_router.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_format.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
event_format_test.go chore: remove goroutine PID logging (#8851) 2025-08-10 22:54:29 +02:00
event_writer.go feat: add a EXCLUSION to the logger (#8212) 2025-07-04 00:08:23 +02:00
event_writer_base.go ci: detect and prevent empty case statements in Go code (#11593) 2026-03-10 02:50:28 +01:00
event_writer_buffer.go tests: make buffer log writer thread safe (#11962) 2026-04-04 16:29:14 +02:00
event_writer_buffer_test.go tests: make buffer log writer thread safe (#11962) 2026-04-04 16:29:14 +02:00
event_writer_conn.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_writer_conn_test.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
event_writer_console.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_writer_file.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
flags.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
flags_test.go chore: remove goroutine PID logging (#8851) 2025-08-10 22:54:29 +02:00
init.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
level.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
level_test.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
logger.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
logger_global.go Fix sub-command log level (#25537) 2023-06-28 08:02:06 +02:00
logger_impl.go ci: detect and prevent empty case statements in Go code (#11593) 2026-03-10 02:50:28 +01:00
logger_impl_test.go tests: make buffer log writer thread safe (#11962) 2026-04-04 16:29:14 +02:00
logger_test.go feat: add a EXCLUSION to the logger (#8212) 2025-07-04 00:08:23 +02:00
manager.go Do not output "Trace" level logs from process manager by default (#24952) 2023-05-27 10:55:24 +00:00
manager_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
misc.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
stack.go feat(log): better parseable and configurable ssh-logs (#9056) 2025-09-11 18:59:24 +02:00