[TODO Roundup] Logging overhaul
See original GitHub issueSummary
Mephisto doesn’t yet have a good system for logging of information. As such we’d like to add loggers via the python Logger
class. At a high level, modules should each have their own loggers. Initially we should be able to configure the log level across the whole application (from DEBUG
to CRITICAL
), and should be able to write both to terminal and to file. NOTE - the logger by default should be configured to use NullHandler
, and mephisto should have a setting to toggle this to StreamHandler
(for writing to terminal) or FileHandler
(for writing to file).
Some helpful information for logging best practices can be found across the web (1, 2, 3…)
Requirements:
- Create a
core.logger
class for Mephisto to store any initializers and helper methods required for creating loggers. - Add a logger object to every class in the
core
,data_model
,server
, andproviders
modules. - Replace existing print statements with logs, and add additional marked logs.
- Add logging to unintended except blocks
Missing logs
- Do a check to see if the database schema is not as expected, and log this to the user.
- Update the wrapper around the call to heroku functions to only surface the “You have too many apps” message if there are actually too many applications, otherwise surface the contained error. This can be tested by creating a heroku account, launching 5 apps without shutting them down, and then launching another.
- Do propper logging around failed MTurk Approve and Reject calls, described here
Wishlist
- Peruse the flow of the
Supervisor
,Operator
, andTaskLauncher
classes to see if there are important control flow operations that might be improved with logging. - Add logging to the data model for similar important control flow paths, things that might require inspection. (Essentially, while debugging other parts of Mephisto, when you find the important variable to introspect, add that to
DEBUG
logging. Important control flow goes intoINFO
, and then errors above that). - Update the logging in
print_run_details
to actually have useful details about the progress of tasks currently being run. - Write
debug
level logging to file, and provide a utility for cleaning up old Mephisto logs.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Todoist gets serious about business with new collaboration ...
Todoist now plans to completely overhaul its collaboration features ... Starting today, all team members can see an activity log so that you ......
Read more >alexh todo - DragonFlyBSD
This detects both buffer underflows and overflows at runtime on free(9) and realloc(9), and prints backtraces from where memory was allocated ...
Read more >Improved note relationship sensing & Catppuccinos!
0 updated Mobile to Obsidian 1.0, got a big user interface overhaul, new navigation bars, tabs, haptic feedback, and more. Definitely read the ......
Read more >Diff - 863f1d7^! - platform/art - Git at Google
Layout needs an overhaul to handle movement of other sections. int32_t ... + // TODO: We should swap the order of these sections...
Read more >School Club Roundup - N3FJP's Amateur Radio Software
ARRL School Club Roundup Contest Log 2.5.3 (System Requirements - Windows 7 through Windows 11. XP and Vista versions here.).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I arrived here via this TODO.
The error message here can be misleading: https://github.com/facebookresearch/Mephisto/blob/2067a756d71aeb1f2f0368402c42fdf84184b3d7/mephisto/abstractions/architects/heroku_architect.py#L371-L377
@jxmsML encountered an error, which was suppressed and mislogged. The error was:
whereas they were presented with:
Covered in #690