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

Not logging last entry #4

Closed
Armageddonw opened this issue Feb 1, 2018 · 2 comments
Closed

Not logging last entry #4

Armageddonw opened this issue Feb 1, 2018 · 2 comments

Comments

@Armageddonw
Copy link

Hello,

I find this library quite usefull, but i've just found a bug.
When calling multiple times LOG, latest entry is not logged. As well as when called only once, nothing in log file is created. For example:
LOG(WARNING) << "Warning";
LOG(INFO) << "Information";
Only "Warning" gets outputed.
Furthermore, when calling two times same severity of logging, example:
LOG(WARNING) << "Warning";
LOG(WARNING) << "Warning";
Nothing is logged, until you change severity.

@badaix
Copy link
Owner

badaix commented Feb 2, 2018

AixLog needs to buffer the log lines to properly format them.
The buffer is "flushed" with every new line character. Alternatively, you can also insert << std::flush into the stream.

To ensure that the really last log line (without any flushing) is logged, I have to add a last sync in the destructor, which I will do tonight:

virtual ~Log()
{
	sync();
}

@badaix
Copy link
Owner

badaix commented Feb 2, 2018

fixed in v1.0.4: d4e8ab4

@badaix badaix closed this as completed Feb 2, 2018
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