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

Logfile: Print start indication block after time sync #2106

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

Slider0007
Copy link
Collaborator

@Slider0007 Slider0007 commented Mar 1, 2023

  • Print start indication block after time sync occured to highlight start of new logs after e.g. a cold boot (no vaild time available, so all logs before time is synced are printed to 1970-01-01.txt)
  • This block is only printed when no time was set before
  • The file log_1970-01-01.txt is not getting deleted if NTP time was not set at boot (e.g. after cold boot) because some of the boot logs are in there. If the time is already set during boot, the file will be handled like all other log files and will be deleted after flow is finished.

This topic was raised by @caco3

@caco3
Copy link
Collaborator

caco3 commented Mar 1, 2023

That looks good to me!

And I now realize, why I never saw the 1970-0101.txt logfile:
It simply gets deleted as it is far to old, see https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/code/components/jomjol_logfile/ClassLogFile.cpp#L302

Can you add an exception for this, so it does not get deleted?

@Slider0007
Copy link
Collaborator Author

And I now realize, why I never saw the 1970-0101.txt logfile:
It simply gets deleted as it is far to old, see https://github.com/jomjol/AI-on-the-edge->device/blob/rolling/code/components/jomjol_logfile/ClassLogFile.cpp#L302

Can you add an exception for this, so it does not get deleted?

That's a good point.
But I would not general skip deleting this file to avoid uncontrolled file size over time. I would rather only keep the file if time was not initially set at boot (which means some logs are in 1970-01-01 file). If during boot time is already set all infos are in correct dated file and regular deletion routine can delete all older files (including 1970-01-01).

@Slider0007
Copy link
Collaborator Author

Slider0007 commented Mar 1, 2023

But I would not general skip deleting this file to avoid uncontrolled file size over time. I would rather only keep the file if time was not initially set at boot (which means some logs are in 1970-01-01 file). If during boot time is already set all infos are in correct dated file and regular deletion routine can delete all older files (including 1970-01-01).

I prepared it like described.
@caco3: Could you please test for verification.

@jomjol jomjol merged commit d3d241c into rolling Mar 1, 2023
@jomjol jomjol deleted the log-start-block-no-time branch March 1, 2023 19:55
@caco3
Copy link
Collaborator

caco3 commented Mar 1, 2023

@Slider0007

On a cold start, I got the (unrelated) message

I (71939) TFLITE SERVER: Round #1 completed (58 seconds)
W (71999) TFLITE SERVER: Time server is configured, but time is not yet set. Check configuration

After some minutes it succeeded. maybe the "Check configuration" is a bit misleading as it is not a configuration issue.

And I like that you only delete it after a new start (with successful time)!

@Slider0007
Copy link
Collaborator Author

After some minutes it succeeded. maybe the "Check configuration" is a bit misleading as it is not a configuration issue.

It could be a config issue, but it's not for sure. Therefore, this part can can be deleted.

@caco3
Copy link
Collaborator

caco3 commented Mar 2, 2023

Therefore, this part can can be deleted.

Done

@caco3 caco3 mentioned this pull request Mar 11, 2023
31 tasks
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

Successfully merging this pull request may close these issues.

3 participants