[CDRIVER-4485] Easier debugging with standardized logging: logging specification Created: 07/Oct/22 Updated: 26/Sep/23 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | PM Bot | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Epic Link: | Easier debugging with standardized logging | ||||||||||||||||||||||||||||
| Upstream Changes Summary: | DRIVERS-1677: The logging spec can be found here. The unified test format changes can be found here. To summarize:
|
||||||||||||||||||||||||||||
| Description |
|
This ticket was split from DRIVERS-1677, please see that ticket for a detailed description. |
| Comments |
| Comment by Kevin Albertson [ 11/Sep/23 ] |
I expect "yes". MONGOC_LOG_LEVEL_CRITICAL is part of the public API. It could be considered for deprecation.
I suggest a validation function be introduced (maybe named: mongoc_log_level_is_valid(int);), so the integer min/max values are not added to public ABI. |
| Comment by Jeremy Mikola [ 11/Sep/23 ] |
|
kevin.albertson@mongodb.com: In that case, what would become of libmongoc's MONGOC_LOG_LEVEL_CRITICAL value? Would it retain the same definition but remain unused? On a related note, would it be worth defining constants for the min/max values of the mongoc_log_level_t enum so that consumers of libmongoc can apply some validation? As I'm implementing an API in |
| Comment by Kevin Albertson [ 01/Sep/23 ] |
|
The specification defines Critical as more severe than Error. At present, the specification does not use the Critical level. libmongoc does not log anything with MONGOC_LOG_LEVEL_CRITICAL. If the specification adds Critical log messages in the future, I propose libmongoc log those with MONGOC_LOG_LEVEL_ERROR (not MONGOC_LOG_LEVEL_CRITICAL). Drivers are expected to log Critical messages if the application is configured to log Error or more severe:
|