flutter_ytlog 0.0.8 copy "flutter_ytlog: ^0.0.8" to clipboard
flutter_ytlog: ^0.0.8 copied to clipboard

Log Util for Flutter

A logging utility class that supports color-coded logs in the terminal and enables writing logs to a file for persistent storage.

Usage #

import 'package:flutter_ytlog/flutter_ytlog.dart';

Log.d('DEMO', 'Debug message');
Log.i('DEMO', 'Info message');
Log.w('DEMO', 'Warning message');
Log.e('DEMO', 'Error message');

Initialize configuration (optional) #

Log.init(enable: true, writeToFile: true);

Flush queued logs (optional) #

When logging very frequently (especially with writeToFile: true), logs are queued to keep output ordering consistent. You can wait for all queued logs to finish:

await Log.flush();

Example app #

See example/ for a runnable Flutter app that demonstrates console colors, burst logging, file output, and flush().

Get log folder #

Directory logDir = await Log.getLogDir();

Get current log file #

File logFile = await Log.getLogFile();
1
likes
140
points
68
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Log Util for Flutter

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, intl, path_provider

More

Packages that depend on flutter_ytlog