custom enable log

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-10 20:46:44 +08:00
parent f4d3ec39a0
commit 89a418c7c5
3 changed files with 56 additions and 35 deletions

View File

@@ -68,45 +68,50 @@ void main() async {
Request();
await Request.setCookie();
RecommendFilter();
// 异常捕获 logo记录
const String buildConfig = '''\n
if (GStorage.enableLog) {
// 异常捕获 logo记录
const String buildConfig = '''\n
Build Time: ${BuildConfig.buildTime}
Commit Hash: ${BuildConfig.commitHash}''';
final Catcher2Options debugConfig = Catcher2Options(
SilentReportMode(),
[
FileHandler(await getLogsPath()),
ConsoleHandler(
enableDeviceParameters: false,
enableApplicationParameters: false,
enableCustomParameters: true,
)
],
customParameters: {
'BuildConfig': buildConfig,
},
);
final Catcher2Options debugConfig = Catcher2Options(
SilentReportMode(),
[
FileHandler(await getLogsPath()),
ConsoleHandler(
enableDeviceParameters: false,
enableApplicationParameters: false,
enableCustomParameters: true,
)
],
customParameters: {
'BuildConfig': buildConfig,
},
);
final Catcher2Options releaseConfig = Catcher2Options(
SilentReportMode(),
[
FileHandler(await getLogsPath()),
ConsoleHandler(
enableCustomParameters: true,
)
],
customParameters: {
'BuildConfig': buildConfig,
},
);
final Catcher2Options releaseConfig = Catcher2Options(
SilentReportMode(),
[
FileHandler(await getLogsPath()),
ConsoleHandler(
enableCustomParameters: true,
)
],
customParameters: {
'BuildConfig': buildConfig,
},
);
Catcher2(
debugConfig: debugConfig,
releaseConfig: releaseConfig,
runAppFunction: () {
runApp(const MyApp());
},
);
Catcher2(
debugConfig: debugConfig,
releaseConfig: releaseConfig,
runAppFunction: () {
runApp(const MyApp());
},
);
} else {
runApp(const MyApp());
}
// 小白条、导航栏沉浸
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);