gazelle_logger

Last updated:

0 purchases

gazelle_logger Image
gazelle_logger Images
Add to Cart

Description:

gazelle logger

Gazelle Logger Plugin #
The Gazelle Logger Plugin provides logging functionality for Gazelle applications.
It allows developers to log incoming requests and outgoing responses, making it easier to debug and monitor application behavior.
Based on logger.
Installation #
To use the Gazelle Logger Plugin, add gazelle_logger as a dependency in your pubspec.yaml file:
dependencies:
gazelle_core: <latest-version>
gazelle_logger: <latest-version>
copied to clipboard
Then, run dart pub get to install the package.
Usage #
Import the package in your Dart file:
import 'package:gazelle_core/gazelle_core.dart';
import 'package:gazelle_logger/gazelle_logger.dart';

void main() async {
final app = GazelleApp(
routes: [
GazelleRoute(
name: "hello_gazelle",
get: (context, request, resonse) async => GazelleResponse(
statusCode: GazelleHttpStatusCode.success.ok_200,
body: "Hello, Gazelle!",
),
preRequestHooks: (context) => [
context.getPlugin<GazelleLoggerPlugin>().logRequestHook,
],
postResponseHooks: (context) => [
context.getPlugin<GazelleLoggerPlugin>().logResponseHook,
],
)
],
plugins: [
GazelleLoggerPlugin(),
],
);

await app.start();
print("Gazelle listening at ${app.serverAddress}");
}
copied to clipboard
The logRequestHook logs incoming requests, while the logResponseHook logs outgoing responses.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.