Skip to content

Bevy_utils should not force tracing's release_max_level_info crate feature #4069

@shanesveller

Description

@shanesveller

Bevy version

0.6.1 and current main

Operating system & version

Applicable to all

What you did

Include a direct/transitive dependency on bevy_utils, which is a dependency of most bevy_* internal crates, some of which are a literal or de facto required dependency of the top-level bevy crate.

What you expected to happen

I should be able to include my preferred level of compile-time verbosity features on the tracing crate, including something more verbose than release_max_level_info or no limit at all.

What actually happened

I am forced to use the release_max_info crate feature on tracing which sets a limit on how much verbosity I can produce in release binaries, as tracing calls and attribute macros that are lower verbosity (debug or trace in this example) are fully compiled away prior to runtime.

Additional information

As a workaround, I would need to either fork-and-patch bevy_utils, or produce a Cargo profile that mimics release profile but will not receive the effects of this tracing crate flag, which currently requires re-enabling debug_assertions. If the linked line could be converted to an on-by-default crate feature of bevy_utils that was not also rigidly enforced anywhere else in the bevy crate tree, I think I could continue to use upstream code but get the verbosity I situationally desire.

Obviously this is not a common scenario and the performance overhead of each verbosity level is observable, but I think encouraging via documentation and defaults would be preferable to choosing inflexibly for your downstream users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UtilsUtility functions and typesC-BugAn unexpected or incorrect behaviorC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions