SkyLogger Flutter
SkyLogger Flutter is a logger to SkyAnalytics
Installation
Add the following to your pubspec.yaml file:
dependencies:
skylogger: ^0.1.0
Usage
import 'package:skylogger/skylogger_flutter.dart';
SkyLogger.error('This is an error');
SkyLogger.debug('This is a debug');
To more control, you can define the folder to store the logs:
SkyLogger.error('This is an error', folder: 'admin');
SkyLogger.debug('This is a debug', folder: 'admin');
Viewing logs
To view the logs, you can use the SkyLoggerViewer widget
Navigator.push(
context,
MaterialPageRoute(builder: (_) => const SkyLoggerViewer()),
),
Exporting logs
To export the logs as a ZIP file, you can use the LoggerReader.zipLogs() method
final zipFile = await LoggerReader.zipLogs();
Create ZIP file
To create a ZIP file from directory, you can use the LoggerReader.zipFile method
final directory = Directory('path/to/logs');
final zipFile = await LoggerReader.zipFile(directory, zipFileName: 'logs');