-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from LezdCS/develop
Setup Talker Flutter for logging
- Loading branch information
Showing
18 changed files
with
324 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; | ||
import 'package:talker_flutter/talker_flutter.dart'; | ||
|
||
class CrashlyticsTalkerObserver extends TalkerObserver { | ||
CrashlyticsTalkerObserver(); | ||
|
||
@override | ||
void onError(err) { | ||
FirebaseCrashlytics.instance.recordError( | ||
err.error, | ||
err.stackTrace, | ||
reason: err.message, | ||
); | ||
} | ||
|
||
@override | ||
void onException(err) { | ||
FirebaseCrashlytics.instance.recordError( | ||
err.exception, | ||
err.stackTrace, | ||
reason: err.message, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
library globals; | ||
|
||
import 'package:talker_flutter/talker_flutter.dart'; | ||
|
||
String appName = "IRL Link"; | ||
String packageName = "com.irllink"; | ||
String version = "1.0.0"; | ||
String buildNumber = "1"; | ||
Talker? talker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart'; | ||
import 'package:talker_dio_logger/talker_dio_logger_settings.dart'; | ||
import 'package:irllink/src/core/utils/globals.dart' as globals; | ||
|
||
Dio initDio() { | ||
final talker = globals.talker; | ||
var dio = Dio(); | ||
dio.interceptors.add( | ||
TalkerDioLogger( | ||
talker: talker, | ||
settings: TalkerDioLoggerSettings( | ||
requestFilter: (RequestOptions options) => kDebugMode ? true : !options.path.contains('api.twitch.tv'), | ||
responseFilter: (response) => kDebugMode ? true : ![200, 202].contains(response.statusCode), | ||
), | ||
), | ||
); | ||
|
||
return dio; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.