Dart's logging package defines several logging levels. Below are the guidelines and examples for each level.
Guideline: Can use on any continuous user interaction, hovering, every paint cycle, etc.
Example:
logger.finest('User hovered over button with ID: $buttonId');Guideline: ONLY USER EVENTS excluding ones that are continuously called (i.e., no hovering, but clicks are ok).
Example:
logger.finer('User clicked on button with ID: $buttonId');Guideline: More high-level user events.
Example:
logger.fine('User completed the signup process.');Guideline: Log configuration details.
Example:
logger.config('Application configuration loaded: $configSettings');Guideline: General informational messages.
Example:
logger.info('User successfully logged in.');Guideline: Potentially harmful situations.
Example:
logger.warning('API call failed, retrying...');Guideline: Serious errors that require immediate attention.
Example:
logger.severe('Database connection failed: $error');Guideline: Extremely severe issues that may cause the application to abort.
Example:
logger.shout('Out of memory error: system shutting down!');