パッケージ、リポジトリ、アプリカテゴリを検索

quick_log のカバー
パッケージ詳細v5.5.3

quick_log

Dart用の使いやすく拡張可能なログパッケージ。特にライブラリで使用する場合に有用であり、インポートされたライブラリからのログ出力をアプリケーションが制御できるようにします。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
4910
いいね数
21
Pub ポイント
150

パッケージをインストール

flutter pub add quick_log

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Quick Log は、シンプルさと柔軟性を重視して設計された軽量で拡張可能な Dart ロギングパッケージです。ライブラリがログを出力できるようにし、ホストアプリケーションによって制御できるため、共有コードでのデバッグやモニタリングに最適です。すべての主要プラットフォームに対応しており、一貫したロギング体験を提供します。ログレベル、出力形式、宛先をカスタマイズ可能でありながら、最小限のオーバーヘッドを維持しています。モジュール構造により、既存プロジェクトへの統合も容易です。

用途

  • ライブラリレベルのログ記録
  • クロスプラットフォームデバッグ
  • 実行時ログ制御
  • アプリケーション監視
  • エラー追跡
  • 開発時診断

主な機能

  • 設定可能なログレベル
  • 拡張可能なバックエンドシステム
  • 集中型ログ管理
  • Platform-agnostic
  • 最小限のパフォーマンスへの影響
  • カスタマイズ可能な出力形式

適している対象

  • Dart ライブラリの作成者
  • クロスプラットフォームアプリ
  • デバッグツール
  • リアルタイム監視システム
  • 開発者向けのユーティリティ

注意事項

  • アプリケーションレベルの構成が必要です
  • 高度な機能を使用するには追加のセットアップが必要になる場合があります
  • 高ボリュームの生産ログ記録に最適化されていません
  • 限定された組み込み分析
  • 外部の構成ファイルに依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

An easy to use and extendable logging package for Dart. Especially useful for use in libraries, as it allows application to control logging from the imported libraries.

Console Printer Output

Features

  • Ability to filter logs from imported libraries
  • 100% configurable (print logs to console, write to file or send to backend all possible!)
  • Similar to other logging packages, so nothing new to learn

Usage

A simple usage example:

import 'package:quick_log/quick_log.dart';

void main() {
  const log = Logger('LogExample');

  log.debug('this is a debug message');
  log.info('this is an info message');
}

Configuring logger output:

import 'package:quick_log/quick_log.dart';

void main() {
  const log = Logger('LogExample');

  Logger.writer = ConsolePrinter(minLevel: LogLevel.info);

  log.d('this is a debug message');
  log.i('this is an info message');
}

Ignoring logs:

import 'package:quick_log/quick_log.dart';

class ExampleLogger extends Logger {
  const ExampleLogger(String name) : super(name, 'ExampleLogger');
}

void main() {
  const log = ExampleLogger('LogExample');

  Logger.writer = ConsolePrinter(onlyTags: []);
  // Or
  Logger.writer = ConsolePrinter(exceptTags: [log.name]);

  // These messages won't be printed
  log.d('this is a debug message');
  log.i('this is an info message');
}

Can be used in tests by using the LogStreamWriter:

import 'package:quick_log/quick_log.dart';

test('test', () {
  const log = Logger('LogExample');
  final writer = LogStreamWriter();
  Logger.writer = writer;

  log.i('this line was executed');
  
  expect(writer.pastMessages.length, 1);
  expect(writer.lastMessage.message, 'this is an info message');
});

Please file feature requests and bugs at the issue tracker.

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト