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

Compact format doesn't behave as specified in the docs #3157

Open
nicklan opened this issue Nov 26, 2024 · 0 comments
Open

Compact format doesn't behave as specified in the docs #3157

nicklan opened this issue Nov 26, 2024 · 0 comments

Comments

@nicklan
Copy link

nicklan commented Nov 26, 2024

Bug Report

Version

v0.3.18

Platform

Linux 6.11.9 #1 SMP PREEMPT_DYNAMIC x86_64 GNU/Linux

Crates

tracing-subscriber

Description

The Compact docs say:

  • A more compact representation of the event’s Level is used
  • additional information—such as the event’s target—is disabled by default.

But if you look right below that you'll see the example output has both the full width level names, and includes the target. This is also what I observe when setting this formatter in practice.

I would have expected instead of:

2022-02-17T19:51:05.809287Z  INFO fmt_compact: preparing to shave yaks number_of_yaks=3

which is what you get today and what the example shows, for this to print something like:

2022-02-17T19:51:05.809287Z  I: preparing to shave yaks number_of_yaks=3
nicklan added a commit to delta-io/delta-kernel-rs that referenced this issue Dec 6, 2024
<!--
Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md
2. Run `cargo t --all-features --all-targets` to get started testing,
and run `cargo fmt`.
  3. Ensure you have added or run the appropriate tests for your PR.
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]
Your PR title ...'.
  5. Be sure to keep the PR description updated to reflect all changes.
-->

## What changes are proposed in this pull request?
<!--
Please clarify what changes you are proposing and why the changes are
needed.
The purpose of this section is to outline the changes, why they are
needed, and how this PR fixes the issue.
If the reason for the change is already explained clearly in an issue,
then it does not need to be restated here.
1. If you propose a new API or feature, clarify the use case for a new
API or feature.
  2. If you fix a bug, you can clarify why it is a bug.
-->

This PR provides 3 ways for engines to hook into our logging:
1. getting a struct `Event` type with relevant information that they can
format
2. A very simple call that will just pick some defaults and give them a
string
3. A slightly more complex one that lets them control the string
formatting a little, but still ultimately just hands over a string

Note that the `Compact` format seems a bit broken upstream. I've filled
tokio-rs/tracing#3157 for that.

<!--
Uncomment this section if there are any changes affecting public APIs:
### This PR affects the following public APIs

If there are breaking changes, please ensure the `breaking-changes`
label gets added by CI, and describe why the changes are needed.

Note that _new_ public APIs are not considered breaking.
-->

Adds 3 new public ffi APIs

## How was this change tested?
<!--
Please make sure to add test cases that check the changes thoroughly
including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please
clarify how you tested, ideally via a reproducible test documented in
the PR description.
-->

Running in `read_table`, and unit tests
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

No branches or pull requests

1 participant