pd_log 0.8.4
pd_log: ^0.8.4 copied to clipboard
Cross-platform Flutter logging with pure Dart; buffered file writes; no platform channels.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:pd_log/pd_log.dart';
import 'routes.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
PDLog.configure(const PDLogConfig(
minLevel: LogLevel.verbose,
useConsole: true,
showCaller: false,
showTimestamp: false,
fileLoggingMinLevel: LogLevel.info,
fileLoggingEnabled: true,
fileLoggingFlushIntervalMs: 2000,
fileLoggingMaxBufferEntries: 100,
fileLoggingMaxBufferBytes: 65536,
));
PDLog.i('PDLog Example App starting...');
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'PDLog 演示应用',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
initialRoute: Routes.home,
routes: Routes.routes,
);
}
}