strategic_logger 0.1.5-beta copy "strategic_logger: ^0.1.5-beta" to clipboard
strategic_logger: ^0.1.5-beta copied to clipboard

A strategic logger solution for many strategies like Crashlytics, Analytics, ConsoleLog and many as you want.

Strategic Logger - Log Smart, Not Hard – One Call Logs All! #

Strategic Logger is a versatile logging framework designed to support multiple logging strategies, including console logging, Firebase Analytics, and Firebase Crashlytics. It's built to be flexible and easy to extend, making it ideal for applications of any size that need reliable logging mechanisms.

Buy Me A Coffee

Features #

  • Multiple Log Strategies: Easily integrate with different logging services like Firebase Analytics and Firebase Crashlytics.

  • Customizable: Extendable to include custom logging strategies depending on your application needs.

  • Easy to Use: Simple API for logging messages, errors, and fatal incidents across all integrated services.

  • Robust Error Handling: Includes predefined error types for handling common logging errors effectively.

Getting Started #

To get started with Strategic Logger, add it to your project as a dependency:

dependencies:strategic_logger: ^1.0.0

Initialization #

Initialize the logger once during the startup of your application:

import 'package:strategic\_logger/strategic\_logger.dart';

void main() {
    logger.initialize(
        level: LogLevel.info,
        strategies: [
            ConsoleLogStrategy(),
            FirebaseAnalyticsLogStrategy(),
            FirebaseCrashlyticsLogStrategy(),
        ],
    );
}

Usage #

Logging messages is straightforward:

logger.log('This is an info log');
logger.error('This is an error message');
logger.fatal('This is a fatal error');

You can also log detailed events:


logger.log('User logged in', event: LogEvent(eventName: 'user\_login'));

Documentation #

For full documentation, including all configuration options and advanced usage examples, visit [Documentation Link].

Extending the Logger #

To add a custom log strategy, extend the LogStrategy class:


class MyCustomLogStrategy extends LogStrategy {
    @override
    Future log({dynamic message, LogEvent? event}) async {
    // Implement custom logging logic here
    }
}

Register your custom strategy during logger initialization.

Contributing #

Contributions are welcome! Please read the contributing guide on our GitHub repository to get started.

License #

Strategic Logger is released under the MIT License.

Notes for Enhancement #

  • Examples: Include more detailed examples that showcase complex scenarios or integration with other systems.

  • Advanced Configuration: If your logger supports dynamic levels or filters, document how to configure these.

  • Community and Support: Mention how users can ask questions, report issues, or contribute to the documentation.

  • Versioning and Updates: Provide information on how the project handles new versions and backward compatibility.

By ensuring that your README.md is clear, informative, and comprehensive, you enhance the usability of your package and help ensure it meets the quality standards expected by the Dart and Flutter community on pub.dev.

9
likes
0
pub points
60%
popularity

Publisher

verified publishersauloroncon.com.br

A strategic logger solution for many strategies like Crashlytics, Analytics, ConsoleLog and many as you want.

Repository (GitHub)
View/report issues

Topics

#logging #crashlytics #firebase #error

Documentation

Documentation

License

unknown (license)

Dependencies

firebase_analytics, firebase_crashlytics, flutter, sentry_flutter

More

Packages that depend on strategic_logger