GodotModding / GodotModding/godot-mod-loader

prettier logging

Open
#450 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
GDScript
Stars
675
Forks
54
Avg merge
2m
Merged PRs (30d)
2

Description

this includes prefixing the source file that started the log

```gdscript
static func log_prefix(stack) -> String:
if len(stack) > 1:
var call_site = stack[1]
var basename = call_site["source"].get_file().get_basename()
var line_num = str(call_site.get("line", 0))
if call_site["source"].match("*/test/*"):
return "{" + basename + ":" + line_num + "}: "
elif call_site["source"].match("*/addons/*"):
return "<" + basename + ":" + line_num + ">: "
else:
return "[" + basename + ":" + line_num + "]: "
return ""
```
ref https://github.com/russmatney/log.gd/blob/main/addons/log/log.gd#L516-L527

and also print_rich when in the editor to use
- colors for each log level and
- reduce visual noise by hiding information like timestamps or
- the mod loader log names within bbcode hint tags (`[hint={tooltip text displayed on hover}]{text}[/hint]`)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.