Search packages, repositories and app categories

GitHub repositorywmtrnsapanzaveri/snug_logger

snug_logger

Use to pertify the logs in flutter application

snug_logger project cover
Stars
3
Forks
2
Last push (UTC)
Mar 5, 2026
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

Snug Logger 🛋️

Snug_Logger

A colorful, structured logger for Flutter apps.

Snug Logger helps you:

  • read logs faster with clean formatting and colors
  • log by intent (debug, info, error, production)
  • inspect Dio network traffic with optional cURL output
  • get readable stack traces for error debugging

Install

dependencies:
  snug_logger: ^1.0.15
flutter pub get

Quick Start

import 'package:snug_logger/snug_logger.dart';

snugLog('App started', logType: LogType.info);
snugLog('Fetching user profile', logType: LogType.debug);
Error Logging with Stack Trace
try {
  throw Exception('Something went wrong');
} catch (error, stackTrace) {
  snugLog(
    error,
    logType: LogType.error,
    stackTrace: stackTrace,
  );
}

Network Logging (Dio)

_dio.interceptors.add(
  SnugDioLogger(
    requestHeaders: true,
    requestData: true,
    responseHeaders: true,
    responseData: true,
    showCurl: true,
    logPrint: (object) => debugPrint(object.toString()),
  ),
);

When showCurl: true is enabled, Snug Logger prints reproducible cURL commands so you can quickly share failing requests with backend teams.

What You Can Configure

  • requestHeaders: include request headers
  • requestData: include request body/query
  • responseHeaders: include response headers
  • responseData: include response body
  • showCurl: print cURL command for each request

Advanced Stack Trace Utilities

If you want direct control over stack trace formatting:

final formatted = StackTraceFormatter.format(stackTrace);
final terse = StackTraceFormatter.formatTerse(stackTrace);
final snug = StackTraceFormatter.formatForSnugLogger(stackTrace);

Contributing

Thanks to Contributors

Thanks to everyone who contributed features, fixes, docs, and reviews, including the cURL printing enhancement.

Contributor Wall

Contributors

wmtrnsapanzaveri GitHub avatar
LanguagesDartC++CMakeHTMLSwiftCKotlinObjective-C

Packages published by this repository

Dependencies used

Dependency list 4 items

  • flutter{"sdk":"flutter"}
  • dio^5.7.0
  • lintsDevelopment^4.0.0
  • testDevelopment^1.25.8

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗