Skip to content

Allow customizing output of godot_{warn,error}! #1219

Open
@jjant

Description

@jjant

Hi, we use tracing in my project for logging.

I whipped up a quick tracing subscriber that routes tracing logs to Godot via godot_{print,warn,error}! (corresponding to the tracing log levels info and lower, warn, and error, respectively).

Info levels get printed fine:

Image

However, I have a couple issues with warn/error logs (in the screenshot, I'm using push_warning for warnings, and godot_error! for errors):

Image
  • With push_warning:

    • the message includes the push_warning: string, which I don't want. I see that some built-in warnings in Godot don't include that, so it might be possible.
    • the stack trace points to variant_utility.cpp:1118, I want to customize that to point to my code (which I can since tracing makes that information available to me)
  • With godot_error!/godot_warn!:

    • The message includes the (fully qualified) name of writer which calls godot_error!, I want to instead point to my code which called tracing::error!.
    • The stack trace is equally "wrong".

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: engineGodot classes (nodes, resources, ...)featureAdds functionality to the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions