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

Yasio uses double newline in logs #1990

Closed
smilediver opened this issue Jun 14, 2024 · 0 comments
Closed

Yasio uses double newline in logs #1990

smilediver opened this issue Jun 14, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@smilediver
Copy link
Contributor

Yasio always logs with a double newline adding empty lines:

[yasio][1718380710550][global] the yasio-4.2.2 is initialized, the size of per transport is 65864 when object_pool enabled.

[yasio][1718380710550][global] sizeof(io_event)=80

[yasio][1718380962389][index: 0] start query 127.0.0.1...

The issue is that one newline is added when formatting the log string here:

auto __msg = ::yasio::strfmt(127, "[yasio][%lld]" format "\n", ::yasio::clock<system_clock_t>(), ##__VA_ARGS__); \

Then another one is added when printing here:

# define YASIO_LOG_TAG(tag, format, ...) printf((tag format "\n"), ##__VA_ARGS__)

I'm not sure which one should be removed, but my guess would be the one in printf.

This is probably affected by the same issue too:

# define YASIO_LOG_TAG(tag, format, ...) OutputDebugStringA(::yasio::strfmt(127, (tag format "\n"), ##__VA_ARGS__).c_str())

@halx99 halx99 closed this as completed in 299f89d Jun 14, 2024
@halx99 halx99 added this to the 2.1.4 milestone Jun 14, 2024
@halx99 halx99 added the bug Something isn't working label Jun 14, 2024
halx99 added a commit that referenced this issue Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants