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

Rename Crystal::System.print_error(fmt, *args, &) to printf #14617

Conversation

ysbaddaden
Copy link
Contributor

The method doesn't print anything but merely formats a string using a subset of C printf, hence the renaming as printf(fmt, *args, &).

Also adds a #print_error(bytes) method to write to the standard error directly, without any formatting, that may be done separately (e.g. into a buffer) then written. Using a buffer is useful to avoid interleaved error messages with MT for example.

Keeps #print_error(fmt, *args) that now merely uses the other two methods.

This has been extracted from #14599.

The method doesn't print anything but merely formats a string using a
subset of C printf, hence the renaming as `printf(fmt, *args, &)`.

Also adds a `#print_error(bytes)` method to write to the standard error
directly, without any formatting, that may be done separately (e.g. into
a buffer) then written. Using a buffer is useful to avoid interleaved
error messages with MT for example.

Keeps `#print_error(fmt, *args)` that now merely uses the other two
methods.
@straight-shoota straight-shoota added this to the 1.13.0 milestone May 23, 2024
@straight-shoota straight-shoota changed the title Rename Crystal::System.print_error(fmt, *args, &) as printf Rename Crystal::System.print_error(fmt, *args, &) to printf May 23, 2024
@straight-shoota straight-shoota merged commit e043a25 into crystal-lang:master May 24, 2024
61 checks passed
@ysbaddaden ysbaddaden deleted the enhancement/crystal-print-error branch May 24, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants