-
-
Notifications
You must be signed in to change notification settings - Fork 70
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 #11 from Frezyx/dev
Release v 0.7.0
- Loading branch information
Showing
28 changed files
with
298 additions
and
237 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
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export 'log_level.dart'; | ||
export 'talker_data.dart'; |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
import 'package:talker/src/models/talker_data/talker_data.dart'; | ||
import 'package:talker/src/observers/talker_observer.dart'; | ||
import 'package:talker_error_handler/talker_error_handler.dart'; | ||
|
||
/// Manager to wrap all observers | ||
class TalkerObserversManager { | ||
TalkerObserversManager(this.observers); | ||
final List<TalkerObserver> observers; | ||
|
||
/// Called when [Talker] handle an error / exception | ||
void onError(ErrorDetails container) { | ||
/// Called when [Talker] handle an [TalkerError] | ||
void onError(TalkerError talkerError) { | ||
for (final o in observers) { | ||
o.onError?.call(container); | ||
o.onError?.call(talkerError); | ||
} | ||
} | ||
|
||
/// Called when [Talker] handle an log | ||
void onLog(TalkerDataInterface data) { | ||
/// Called when [Talker] handle an [TalkerException] | ||
void onException(TalkerException talkerException) { | ||
for (final o in observers) { | ||
o.onLog?.call(data); | ||
o.onException?.call(talkerException); | ||
} | ||
} | ||
|
||
/// Called when [Talker] handle an [TalkerDataInterface] log | ||
void onLog(TalkerDataInterface log) { | ||
for (final o in observers) { | ||
o.onLog?.call(log); | ||
} | ||
} | ||
} |
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,17 +1,20 @@ | ||
import 'package:talker/src/models/talker_data/talker_data.dart'; | ||
import 'package:talker_error_handler/talker_error_handler.dart'; | ||
|
||
/// Base observer class for | ||
/// to create your own observers | ||
class TalkerObserver { | ||
const TalkerObserver({ | ||
this.onError, | ||
this.onLog, | ||
this.onException, | ||
}); | ||
|
||
/// Called when [Talker] handle an error / exception | ||
final Function(ErrorDetails err)? onError; | ||
/// Called when [Talker] handle an [TalkerError] | ||
final Function(TalkerError err)? onError; | ||
|
||
/// Called when [Talker] handle an log | ||
final Function(TalkerDataInterface data)? onLog; | ||
/// Called when [Talker] handle an [TalkerException] | ||
final Function(TalkerException err)? onException; | ||
|
||
/// Called when [Talker] handle an [TalkerDataInterface] log | ||
final Function(TalkerDataInterface log)? onLog; | ||
} |
Oops, something went wrong.