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

Merged
merged 10 commits into from
Mar 1, 2025
Merged

Support BYO Logging #2377

merged 10 commits into from
Mar 1, 2025

Conversation

3lpsy
Copy link
Contributor

@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 d6b47eb

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.19 2.0.20
api-example-js 2.0.15 2.0.16
log 2.2.3 2.3.0
log-js 2.2.3 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

@FabianLars FabianLars merged commit 0248150 into tauri-apps:v2 Mar 1, 2025
16 checks passed
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.

2 participants