Skip to content

Conversation

@chernyee
Copy link
Collaborator

Motivate of the pull request

  • To address an existing issue. If so, please provide a link to the issue:
  • Breaking new feature. If so, please describe details in the description part.

Describe the technical details

  1. Implement simple backend logger to capture application for troubleshoot and debugger use.
  2. Support file rotating capability with configurable max size and backup count options.
  3. The log file will be saved in User home directory
  4. The log file name will be "rpe.log"
  5. Log file behavior: Resume if the rpe.log exists.

Which part of the code base require a change

  • Frontend:
  • Backend: RsLogger module
  • Library: <Specify the library name, e.g. npm packages>
  • Plug-in: <Specify the plugin name, e.g. Webpack, jtest>
  • Documentation
  • Regression tests
  • Continuous Integration (CI) scripts

@codecov
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 25.28090% with 133 lines in your changes missing coverage. Please review.

Project coverage is 68.35%. Comparing base (b5a3271) to head (5298700).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
backend/submodule/peripherals.py 0.77% 128 Missing ⚠️
backend/restapi_server.py 78.57% 3 Missing ⚠️
backend/submodule/rs_logger.py 94.28% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #230      +/-   ##
==========================================
+ Coverage   68.24%   68.35%   +0.11%     
==========================================
  Files         109      110       +1     
  Lines        8527     8574      +47     
==========================================
+ Hits         5819     5861      +42     
- Misses       2708     2713       +5     

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

Copy link
Collaborator

@shivaahir158 shivaahir158 left a comment

Choose a reason for hiding this comment

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

Looks ok to me after discussing the ticket.

@ravikiranchollangi
Copy link
Contributor

I need to review this one, will merge after.

if not logger.handlers:
logger.addHandler(get_file_handler(filename, max_bytes, backup_count))
logger.addHandler(get_console_handler())
logger.setLevel(logging.DEBUG)
Copy link
Contributor

Choose a reason for hiding this comment

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

The default log level as debug is ok for now, we should revisit this when we go to production. Also, it must be read from raptor-dev.json if we need to change the level.
These are near future enhancements.

@ravikiranchollangi ravikiranchollangi merged commit b60093c into main Oct 12, 2024
10 of 11 checks passed
@ravikiranchollangi ravikiranchollangi deleted the task/RPE-127/Add-simple-logger-for-BE-log-messages branch October 12, 2024 21:05
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.

4 participants