Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Merge #129
Browse files Browse the repository at this point in the history
129: Set log level to debug if app is not released r=klochowicz a=holzeis



Co-authored-by: Richard Holzeis <[email protected]>
  • Loading branch information
bors[bot] and holzeis authored Nov 8, 2022
2 parents da30c85 + 99eb50e commit 5950d99
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:f_logs/f_logs.dart';
import 'package:flutter/foundation.dart' as foundation;
import 'package:flutter/material.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -30,6 +31,11 @@ void main() {
FlutterError.presentError(details);
};

final config = FLog.getDefaultConfigurations();
config.activeLogLevel = foundation.kReleaseMode ? LogLevel.INFO : LogLevel.DEBUG;

FLog.applyConfigurations(config);

runApp(MultiProvider(providers: [
ChangeNotifierProvider(create: (context) => balanceModel),
ChangeNotifierProvider(create: (context) => seedBackupModel),
Expand Down Expand Up @@ -127,8 +133,13 @@ class _TenTenOneState extends State<TenTenOneApp> {
}

Future<void> _callSync() async {
final balance = await api.getBalance();
if (mounted) setState(() => balanceModel.update(Amount(balance.confirmed)));
try {
final balance = await api.getBalance();
balanceModel.update(Amount(balance.confirmed));
FLog.trace(text: 'Successfully synced wallet');
} on FfiException catch (error) {
FLog.error(text: 'Failed to sync wallet: Error: ' + error.message, exception: error);
}
}

Future<void> setupRustLogging() async {
Expand Down

0 comments on commit 5950d99

Please sign in to comment.