https://github.com/knowbee/swift_log
Streamline Your Logging Experience and Seamlessly Integrate with Any Backend System
https://github.com/knowbee/swift_log
api api-client flutter logger logging
Last synced: 4 months ago
JSON representation
Streamline Your Logging Experience and Seamlessly Integrate with Any Backend System
- Host: GitHub
- URL: https://github.com/knowbee/swift_log
- Owner: knowbee
- License: mit
- Created: 2023-06-23T09:50:33.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T23:12:37.000Z (almost 3 years ago)
- Last Synced: 2025-10-22T23:45:15.587Z (8 months ago)
- Topics: api, api-client, flutter, logger, logging
- Language: Dart
- Homepage: https://pub.dev/packages/swift_log
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# swift_log
A comprehensive logging solution designed specifically for flutter apps.
## Description
The `swift_log` package is a logging solution developed to facilitate comprehensive logging functionalities in flutter applications. It provides the ability to capture and upload logs to a remote server for analysis and debugging purposes.
## Features
- Capturing exceptions with customizable tags, subtags, and log messages
- Capturing events with event names, log messages, and log levels
- Saving events to device storage (They are cleared out as soon as they get pushed to your logs API)
## Getting Started
To get started with the `swift_log` package, follow these steps:
1. Add the `swift_log` dependency to your project's `pubspec.yaml` file:
```yaml
dependencies:
swift_log:
```
2. Import the package and initialize the logger in your code:
```dart
import 'package:swift_log/swift_log.dart';
void main() async {
await SwiftLog.init(
(options) {
options.apiPrefix = 'https://your-custom-log-server.com';
options.token = 'yourApiToken';
},
appRunner: () async {
return runApp(
const App(),
);
},
);
// capture and upload logs, with associated events
SwiftLog.captureException(
logMessage: "Exception occurred",
level: LogLevel.error,
exception: e as Exception,
stackTrace: stackTrace,
);
/// track events
SwiftLog.captureEvent(
eventName: "Fetching clients",
logMessage: "Fetching clients",
level: LogLevel.info,
);
}
```
For more details on usage and examples, refer to the example directory.
### Contributing
Contributions to the `swift_log` package are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on this repository.