Thanks to visit codestin.com
Credit goes to github.com

Skip to content

IAmTraffic/log.gd

 
 

Repository files navigation

Unit Tests

russmatney on Patreon dangerruss on Discord russmatney on Mastodon russmatney on Twitch Youtube Badge


Log.gd, a Godot pretty printer

Available on the Godot Asset Library and Github.

I gave a Lightning talk about this addon at Godot Con Boston! Here are the slides.

Log.gd provides a drop-in replacement for GDScript's print(...) function.

It colors the output based on the value passed in, and adds a prefix based on the call-site's file and line number.

Dino output logs (light theme)

Dino output logs (dark theme)

This makes Godot's Output buffer much more readable! And now, I can't live without it :eyeroll:

TLDR

  • Log.pr(...) is a prints(...) replacement (includes spaces between args)
  • Log.prn(...), Log.prnn(...), and Log.prnnn(...) are the same, but include limited newlines + tabs when printing nested arrays and dictionaries
  • Both add prefix with the calling filename and line number (e.g. [Player:34])
  • Both color the output values based on the value's type
  • Log.debug(...), Log.info(...), Log.warn(...), Log.error(...) offer differing log levels

Links

Other Godot Loggers

There are some other great printers/loggers with a variety of features - check them out!

Contributors

Huge thanks to the Log.gd contributors!

About

An ergonomic pretty-printer for gdscript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • GDScript 94.8%
  • GAP 2.3%
  • C# 1.0%
  • HTML 0.7%
  • Clojure 0.6%
  • CSS 0.4%
  • Other 0.2%