get_connect_logger 1.0.0 copy "get_connect_logger: ^1.0.0" to clipboard
get_connect_logger: ^1.0.0 copied to clipboard

discontinuedreplaced by: ts_logger
outdated

Console logger for GetConnect

BM GetConnect Logger #

BM GetConnect Logger is a lightweight and efficient logging package for GetConnect. It logs both the request and response of the GetConnect client, providing valuable insights for debugging and development.

Safety #

This package is designed with production safety in mind. It only logs the request and response when the app is in debug mode, ensuring no sensitive data is logged in a production environment.

Usage #

import 'package:get/get.dart';
import 'package:get_connect_logger/get_connect_logger.dart';

class ApiService extends GetConnect {
  @override
  void onInit() {
    GetConnectLogger.instance.enableLogger(httpClient);
    super.onInit();
  }
}

// Alternatively

class ApiService extends GetConnect {
  ApiService() {
    GetConnectLogger.instance.enableLogger(httpClient);
  }
}

About enableLogger #

enableLogger is a method in the GetConnectLogger singleton class. It enables logging for HTTP requests and responses made by the GetConnect instance.

Despite the number of times enableLogger is called, logging will only be enabled once. This is because enableLogger checks if logging is already enabled before proceeding. If logging is already enabled, enableLogger will return without performing any action.

This design prevents unnecessary multiple logging activations, which could potentially lead to performance issues.

12
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

Console logger for GetConnect

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, get, intl

More

Packages that depend on get_connect_logger