Skip to content

Conversation

@kruskall
Copy link
Member

@kruskall kruskall commented Aug 4, 2025

Proposed commit message

ObserverLogs is relying on a testing package in a non-test package

move to logptest

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

ObserverLogs is relying on a testing package in a non-test package

move to logptest
@kruskall kruskall requested review from a team as code owners August 4, 2025 21:21
@kruskall kruskall requested review from faec and mauri870 August 4, 2025 21:21
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Aug 4, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @kruskall? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@pierrehilbert pierrehilbert added Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team Team:Security-Linux Platform Linux Platform Team in Security Solution labels Aug 5, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 5, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@khushijain21
Copy link
Contributor

khushijain21 commented Aug 5, 2025

There are some places in beats codebase that use a very clumsy way of setting observer. Now that we have NewTestingLoggerWithObserver - could you also replace those parts?

This is one such instance https://github.com/khushijain21/beats/blob/localLogger13/libbeat/autodiscover/autodiscover_test.go#L759-L761

Thanks for doing this!

@kruskall
Copy link
Member Author

kruskall commented Sep 4, 2025

@elastic/sec-linux-platform friendly ping for review

1 similar comment
@kruskall
Copy link
Member Author

@elastic/sec-linux-platform friendly ping for review

@kruskall
Copy link
Member Author

kruskall commented Oct 8, 2025

@elastic/sec-linux-platform friendly ping for review

@pierrehilbert
Copy link
Collaborator

@nfritts could you please take a look here?

@kruskall kruskall merged commit b5789af into elastic:main Nov 4, 2025
207 of 210 checks passed
@kruskall kruskall deleted the refactor/drop-observerlogs branch November 4, 2025 16:21
@kruskall kruskall added backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Automated backport to the 9.2 branch labels Nov 4, 2025
@kruskall
Copy link
Member Author

kruskall commented Nov 4, 2025

@Mergifyio backport 8.19 9.1 9.2

@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2025

backport 8.19 9.1 9.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 4, 2025
* refactor: replace lopg.ObserverLogs with logptest

ObserverLogs is relying on a testing package in a non-test package

move to logptest

* lint: regenerate notice file

* test: update to NewTestingLoggerWithObserver

* lint: regenerate notice

* lint: remove unused imports

* lint: remove unused imports

* Update console_test.go

* lint: fix linter issues

(cherry picked from commit b5789af)

# Conflicts:
#	filebeat/input/journald/pkg/journalctl/reader_test.go
mergify bot pushed a commit that referenced this pull request Nov 4, 2025
* refactor: replace lopg.ObserverLogs with logptest

ObserverLogs is relying on a testing package in a non-test package

move to logptest

* lint: regenerate notice file

* test: update to NewTestingLoggerWithObserver

* lint: regenerate notice

* lint: remove unused imports

* lint: remove unused imports

* Update console_test.go

* lint: fix linter issues

(cherry picked from commit b5789af)

# Conflicts:
#	filebeat/input/filestream/config_test.go
#	filebeat/input/journald/pkg/journalctl/reader_test.go
#	libbeat/autodiscover/autodiscover_test.go
mergify bot pushed a commit that referenced this pull request Nov 4, 2025
* refactor: replace lopg.ObserverLogs with logptest

ObserverLogs is relying on a testing package in a non-test package

move to logptest

* lint: regenerate notice file

* test: update to NewTestingLoggerWithObserver

* lint: regenerate notice

* lint: remove unused imports

* lint: remove unused imports

* Update console_test.go

* lint: fix linter issues

(cherry picked from commit b5789af)
kruskall added a commit that referenced this pull request Nov 5, 2025
* refactor: replace lopg.ObserverLogs with logptest

ObserverLogs is relying on a testing package in a non-test package

move to logptest

* lint: regenerate notice file

* test: update to NewTestingLoggerWithObserver

* lint: regenerate notice

* lint: remove unused imports

* lint: remove unused imports

* Update console_test.go

* lint: fix linter issues

(cherry picked from commit b5789af)

Co-authored-by: kruskall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Automated backport to the 9.2 branch Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team Team:Security-Linux Platform Linux Platform Team in Security Solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants