Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettier logging #450

Open
Qubus0 opened this issue Nov 18, 2024 · 0 comments
Open

prettier logging #450

Qubus0 opened this issue Nov 18, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@Qubus0
Copy link
Collaborator

Qubus0 commented Nov 18, 2024

this includes prefixing the source file that started the log

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])
@Qubus0 Qubus0 added the enhancement New feature or request label Nov 18, 2024
@KANAjetzt KANAjetzt added this to the 4.x - 7.x milestone Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants