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

[Improvement] Built-in logs with f-string like support #77

Open
shazz opened this issue Jan 7, 2021 · 1 comment
Open

[Improvement] Built-in logs with f-string like support #77

shazz opened this issue Jan 7, 2021 · 1 comment

Comments

@shazz
Copy link
Contributor

shazz commented Jan 7, 2021

it would be great to have a specific logger directive which supports f-string like arguments like:

!log("Current Bank selected: {VIC.BANK} in iteration {i}")

Workaround using a plugin:

module.exports = {
    debug: ({}, args) => {
        console.log(args);
    }
}
!!utils.debug(["Current Bank selected:", VIC.BANK, "in iteration", i])
@nurpax
Copy link
Owner

nurpax commented Feb 7, 2021

I'm a big fan of f-strings in Python but not a big fan of implementing them. :) This was even done a bit poorly in Python, I hear they're going to use a stronger parser in upcoming Python versions to make it less annoying to deal with string quotes.

Python "print" or JS "console.log" style would be simpler. This looks like your !!utils.debug except without the list:

!! print("Current Bank selected:", VIC.BANK, "in iteration", i)

Additionally would need some helper functions like converting to hex strings.

Built-in support for this would be great because this way c64jasm could print the log prints only on the last successful pass, rather than log printing in every compile pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants