Tracer

An asset by wyvernbw
The page banner background of a mountain and forest
Tracer hero image

Quick Information

0 ratings
Tracer icon image
wyvernbw
Tracer

Tracer is an addon for godot 4 for structured, customizable traces, heavily inspired by tracing.✨ Features- Multiple log levels and filtering- Colored output- Useful information such as the script a span is located in, the current thread id and timestamps- Modular design- Support for custom writers*icon sprite is from Terraria*

Supported Engine Version
4.0
Version String
1.0
License Version
GPLv3
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

README image

README image tracer.gd

Sprite is from Terraria

Tracer is an addon for godot 4 for structured, customizable traces, heavily inspired by tracing.

✨ Features

  • Multiple log levels and filtering
  • Colored output
  • Useful information such as the script a span is located in, the current thread id and timestamps
  • Modular design
  • Support for custom writers

🧙‍♂️ How it works

The Tracer autoload stores traces that are then consumed by subscribers. This addond includes a default subscriber in the form of TraceSubscriber. Users are free to implement their own subscribers. Multiple subscribers can run in parallel to log spans with different settings.

Getting Started

You can find this example in examples/test

During initialization of your game (the ready function for example), start by building a subscriber

    # Build a subscriber with all the bells and whistles
    var subscriber = (
        TraceSubscriber
        . new()
        . with_nicer_colors(false)
    ) # default options omitted for simplicity

After which, simply initialize the subscriber by calling it's init method

    subscriber.init()

And that's it. This will add the subscriber as a child to the Tracer autoload and will hook it up to consume the traces. Now you can use the provided functions to create these traces.

    Tracer.info("Game Started!")
    Tracer.debug("Initializing systems... 🧙‍♂️")
    Tracer.warn("Cannot find file 'data.json' 🤔")
    Tracer.error("Cannot communicate with server 😱")

This will result in this output:

[2023-11-02T12:02:36] INFO examples/test/test.gd::_ready: Game Started!
[2023-11-02T12:02:36] DEBUG examples/test/test.gd::_ready: Initializing systems...
[2023-11-02T12:02:36] WARN examples/test/test.gd::_ready: Cannot find file 'data.json' 
[2023-11-02T12:02:36] ERROR examples/test/test.gd::_ready: Cannot communicate with server

🛠️ Installing

  1. clone this repo
  2. move the addons/tracer folder into your own addons folder.
  3. enable the plugin in project settings


Tracer is an addon for godot 4 for structured, customizable traces, heavily inspired by tracing.

✨ Features
- Multiple log levels and filtering
- Colored output
- Useful information such as the script a span is located in, the current thread id and timestamps
- Modular design
- Support for custom writers

*icon sprite is from Terraria*

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Tracer icon image
wyvernbw
Tracer

Tracer is an addon for godot 4 for structured, customizable traces, heavily inspired by tracing.✨ Features- Multiple log levels and filtering- Colored output- Useful information such as the script a span is located in, the current thread id and timestamps- Modular design- Support for custom writers*icon sprite is from Terraria*

Supported Engine Version
4.0
Version String
1.0
License Version
GPLv3
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers