Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BYO Logging #2377

Open
wants to merge 8 commits into
base: v2
Choose a base branch
from
Open

Support BYO Logging #2377

wants to merge 8 commits into from

Conversation

3lpsy
Copy link

@3lpsy 3lpsy commented Jan 31, 2025

Changes

This feature adds a .is_skip_logger flag to the Log Plugin Builder, a skip_logger() method to the Builder, and logic to avoid acquiring (creating) a logger and attaching it to the global logger. Since acquire_logger is pub, a LoggerNotInitialized is added and returned if it's called when the is_skip_looger flag is set.

Why

This permits a crude BYO logging implementation as it avoids attach_logger. I have tracing setup with tracing-log and would just prefer to send the logs there. Additionally, without this change, you cannot create multiple Tauri mock apps for testing. Additionally, the end user can handle the logger but still use the plugin for easy access to the command and JS.

Please let me know if you do not think this approach is useful or if you would like me to make changes. Thanks!

@3lpsy 3lpsy requested a review from a team as a code owner January 31, 2025 03:02
Copy link
Contributor

github-actions bot commented Jan 31, 2025

Package Changes Through c8953ec

There are 2 changes which include log with minor, log-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.17 2.0.18
api-example-js 2.0.13 2.0.14
log 2.2.1 2.3.0
log-js 2.2.1 2.3.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant