Vaibhav Surve e6d05e247e Refactor logging implementation across controllers and services
- Replaced instances of the Logger package with a custom appLogger for consistent logging.
- Introduced app_logger.dart to manage logging with file output and storage permissions.
- Updated all controllers (e.g., DashboardController, EmployeesScreenController, etc.) to use appLogger for logging messages.
- Ensured that logging messages are appropriately categorized (info, warning, error) throughout the application.
- Implemented a file logging mechanism to store logs in a designated directory.
- Cleaned up old log files to maintain only the most recent logs.
2025-06-24 13:11:22 +05:30

35 lines
879 B
Dart

import 'package:flutter/material.dart';
import 'package:marco/helpers/services/app_initializer.dart';
import 'package:marco/view/my_app.dart';
import 'package:provider/provider.dart';
import 'package:marco/helpers/theme/app_notifier.dart';
import 'package:marco/helpers/services/app_logger.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await initLogging();
appLogger.i("App starting...");
try {
await initializeApp();
runApp(
ChangeNotifierProvider<AppNotifier>(
create: (_) => AppNotifier(),
child: const MyApp(),
),
);
} catch (e, stacktrace) {
appLogger.e('App failed to initialize:', error: e, stackTrace: stacktrace);
runApp(
const MaterialApp(
home: Scaffold(
body: Center(child: Text("Failed to initialize the app.")),
),
),
);
}
}