-
Notifications
You must be signed in to change notification settings - Fork 344
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
Timestamp is not in order #36
Comments
Hi kaiduanx, I think the issue is related to #28 where log messages at the beginning of the file can sometimes have a negative nanosecond timestamp (notice the little dash character Could you send me your log file, so I can verify the fix? Best Regards, |
Please send an email to [email protected], I will send the file to you. |
Actually, can you post the file here? You can attach files to GitHub comments; simply drag the file into the text field. Instructions: https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests Example File: ProofOfConcept.txt |
Previously, the decompressor would output negative timestamps when it encountered a log message with a timestamp earlier than the conversion time marked in the log file's checkpoint. This patch fixes this issue by checking for this case and adjusting the output as necessary.
Hey kaiduanx, The problem should be fixed now. Give it a try and let me know if it works. Best Regards, |
@syang0 , the problem is fixed, please see the following log. Many thanks, @syang0 ~/NanoLog/sample$ ./decompressor decompress /tmp/logFile Decompression Complete after printing 2 log messages |
The issue is that the timestamp is not in the right order. The time stamp of the log at 59 line is older than the timestamp of the log at 64 line. I only commented out the runBenMark() function.
~/NanoLog/sample$ ./decompressor decompress /tmp/logFile
2020-07-16 18:12:41.-00022964 main.cc:59 NOTICE[0]: A string, pointer, number, and float: 'Hello World', 0x7ffd9db8d8bc, 512, 3.141590
2020-07-16 18:12:41.-00022108 main.cc:64 NOTICE[0]: Shortend String: 'Hello World' and shortend float 3.14
Decompression Complete after printing 2 log messages
~/NanoLog/sample$ git diff
diff --git a/sample/main.cc b/sample/main.cc
index af67390..c4523cb 100644
--- a/sample/main.cc
+++ b/sample/main.cc
@@ -64,7 +64,7 @@ int main(int argc, char** argv) {
3.14159);
//runBenchmark();
// Optional: Flush all pending log messages to disk
NanoLog::sync();
The text was updated successfully, but these errors were encountered: