Skip to content

Commit

Permalink
Improve README code example
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert221 committed Dec 17, 2020
1 parent 7ef66f5 commit 3021e48
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
[![logging_bugfender pub.dev badge][pub-badge]][pub-badge-link]
[![][build-badge]][build-badge-link]

A library helping integrate Bugfender with the `logging` package.
A library helping integrate Bugfender with the [logging] package.

## Usage

#### Setup

```dart
final loggingListener = LoggingBugfenderListener('my-very-secret-app-key');
Expand All @@ -24,7 +26,28 @@ loggingListener.setCustomData(logUsernameKey, '<some username>');
loggingListener.removeCustomData(logUsernameKey);
```

#### Using the logger

```dart
class FooBarCubit {
final _log = Logger('foo_bar_cubit');
// (...)
void doSomething() {
try {
// (...)
_log.info('Successfuly did something');
} catch (e) {
_log.severe('Failed doing something: $e');
}
}
}
```

[pub-badge]: https://img.shields.io/pub/v/logging_bugfender
[pub-badge-link]: https://pub.dev/packages/logging_bugfender
[build-badge]: https://img.shields.io/github/workflow/status/leancodepl/logging_bugfender/test
[build-badge-link]: https://github.com/leancodepl/logging_bugfender/actions?query=workflow%3A%22test%22

[logging]: https://pub.dev/packages/logging
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: logging_bugfender
description: A library helping integrate Bugfender with the `logging` package.
description: A library helping integrate Bugfender with the logging package.
version: 1.0.0
homepage: https://github.com/leancodepl/logging_bugfender

Expand Down

0 comments on commit 3021e48

Please sign in to comment.