LogarMigrationHelper class

Migration helper to replace existing print() and debugPrint() calls

This class provides static methods that can be used as drop-in replacements for print() and debugPrint() calls during the migration process.

Usage during migration:

  1. Import this file where print() or debugPrint() is used
  2. Replace print() calls with LogarMigrationHelper.print()
  3. Replace debugPrint() calls with LogarMigrationHelper.debugPrint()
  4. Gradually migrate to proper Logar usage with appropriate log levels

Constructors

LogarMigrationHelper.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

debugPrint(String? message, {int? wrapWidth}) → void
Drop-in replacement for debugPrint() function Maps to Logar.debug() with 'DEBUG_PRINT' tag
logBusinessEvent({required String event, Map<String, dynamic>? data}) → void
Helper method to log business logic events
logError({required String message, Object? error, StackTrace? stackTrace, String? tag, Map<String, dynamic>? data}) → void
Helper method to log errors with context
logLifecycle({required String widget, required String event, Map<String, dynamic>? data}) → void
Helper method to log UI lifecycle events
logNetworkError({required String method, required String url, required Object error, StackTrace? stackTrace, String? message}) → void
Helper method to log network errors
logNetworkRequest({required String method, required String url, Map<String, dynamic>? headers, dynamic body, Map<String, dynamic>? queryParams}) → void
Helper method to log network requests
logNetworkResponse({required String method, required String url, required int statusCode, dynamic responseData, String? error}) → void
Helper method to log network responses
logUserInteraction({required String action, String? widget, Map<String, dynamic>? data}) → void
Helper method to log user interactions
logWarning({required String message, String? tag, Map<String, dynamic>? data}) → void
Helper method to log warnings
print(Object? object) → void
Drop-in replacement for print() function Maps to Logar.info() with 'PRINT' tag