Feature Request: Logger Parameter Reorganization for Hazaar 3.0
Problem Statement
The current Logger in Hazaar has a parameter order that is not user-friendly and the $tag parameter is inconveniently placed. Moving the $tag parameter to the end and introducing a default value, potentially derived from the calling function/class, would simplify its usage. This update will be part of a major version release (Hazaar 3.0) and will break compatibility with previous versions. However, this change is justified as the Logger's current documentation is outdated and usage appears to be minimal.
Who will Benefit?
All developers using the Hazaar framework will benefit from this update. It will make the Logger easier to use and more intuitive, especially for those integrating logging into their projects.
Benefits and Risks
Benefits:
- Enhanced Usability: Simplifies the usage of the Logger by reordering parameters.
- Better Defaults: Provides more meaningful default values for the $tag parameter.
- Modernized Documentation: Opportunity to update and improve the Logger documentation.
Risks:
- Breaking Changes: This update will break backward compatibility, requiring code modifications for existing projects using the Logger.
- Learning Curve: Developers accustomed to the current parameter order will need to adapt to the new format.
Proposed Solution
-
Reorder Logger Parameters:
- Move the $tag parameter to the end of the function parameters.
- Introduce a default value for $tag, potentially derived from the calling function/class.
-
Update Default Behavior:
- Implement logic to automatically retrieve and use the calling function/class name as the default $tag value if none is provided.
-
Documentation and Examples:
- Update the Logger documentation to reflect the new parameter order and default behavior.
- Provide examples showcasing the improved usability and new default value mechanism.
-
Migration Guide:
- Create a comprehensive migration guide to assist developers in updating their code to be compatible with Hazaar 3.0.
Priority
High
Severity
High
Acceptance Criteria
- Reordered Logger parameters with $tag moved to the end.
- Implementation of default $tag value derived from the calling function/class.
- Updated documentation reflecting the new parameter order and default behavior.
- Comprehensive migration guide to assist developers in transitioning to Hazaar 3.0.
Note
This feature request involves significant changes to the Logger's API. It will improve usability and make logging more intuitive, but developers will need to update their existing code to adapt to the new parameter order.