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

Init logs and escape messages and refactor loggers #353

Merged
merged 5 commits into from
Apr 24, 2024
Merged

Conversation

armanddidierjean
Copy link
Member

@armanddidierjean armanddidierjean commented Apr 19, 2024

Add a new structure to use different LoggerOutput on the web and on mobile devices. PrintLoggerOutput can be used on the web to display logs in the console.

Closes #226
Closes #277

How to tests?

As we use two LoggerOutput, one on the web and one on mobile devices, the two platform should be tested.

On the web:

  • open the browser console
  • find an action that log something
  • check a message DATE | LEVEL | MESSAGE was printed in the console

On iOS/Android:

  • find an action that log something
  • go to settings>log
  • check that logs are readable

Copy link
Member

@maximeroucher maximeroucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I look like a clown for this one 😄

@codecov-commenter
Copy link

codecov-commenter commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 120 lines in your changes are missing coverage. Please review.

Project coverage is 54.71%. Comparing base (0d9fc27) to head (ccadf51).

Files Patch % Lines
lib/tools/repository/repository.dart 0.00% 38 Missing ⚠️
lib/tools/logs/file_logger_output.dart 0.00% 36 Missing ⚠️
lib/tools/repository/logo_repository.dart 0.00% 20 Missing ⚠️
lib/tools/logs/logger.dart 0.00% 19 Missing ⚠️
lib/tools/logs/print_logger_output.dart 0.00% 6 Missing ⚠️
lib/tools/logs/log.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #353      +/-   ##
==========================================
- Coverage   54.78%   54.71%   -0.08%     
==========================================
  Files         166      168       +2     
  Lines        3665     3670       +5     
==========================================
  Hits         2008     2008              
- Misses       1657     1662       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@armanddidierjean armanddidierjean changed the title Init logs and escape log messages Init logs and escape messages and refactor loggers Apr 20, 2024
Copy link
Member

@maximeroucher maximeroucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one !

@armanddidierjean armanddidierjean added enhancement New feature or request core This PR change the core fix bug This PR fix a bug labels Apr 20, 2024
@guillaumetavernier
Copy link
Contributor

Screenshot_2024-04-23-11-41-27-37_3166164293b8afe0deb3263e48924357.jpg

It seems like there is a problem while parsing some logs

@armanddidierjean
Copy link
Member Author

It seems like there is a problem while parsing some logs

We changed the way logs are stored in a file, thus the app will be unable to parse already existing logs.
We could add code to parse the old syntaxe, but I'm not sure it's worth doing:

  • that would requires more work, and code, to support a syntax that is not used anymore
  • these old logs were already broken. We won't be able to parse them correctly because messages can contains hyphens, which was the separator between the date, level and message.
  • older logs are usually not relevant, and the content of the log is shown in the error

@maximeroucher maximeroucher merged commit cddfd38 into main Apr 24, 2024
11 checks passed
@maximeroucher maximeroucher deleted the init-logs branch April 24, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core This PR change the core enhancement New feature or request fix bug This PR fix a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logs parsing error Titan for web: log page does not work
4 participants