Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/counter_example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ packages:
path: "../../packages/stac_logger"
relative: true
source: path
version: "1.0.0"
version: "1.1.0"
stack_trace:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion examples/movie_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ packages:
path: "../../packages/stac_logger"
relative: true
source: path
version: "1.0.0"
version: "1.1.0"
stack_trace:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion examples/stac_gallery/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ packages:
path: "../../packages/stac_logger"
relative: true
source: path
version: "1.0.0"
version: "1.1.0"
stac_webview:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ scripts:
build:
exec: dart run build_runner build --delete-conflicting-outputs
packageFilters:
ignore: [stac_framework, movie_app]
ignore: [stac_framework, movie_app, stac_logger]
watch:
exec: dart run build_runner watch --delete-conflicting-outputs
packageFilters:
ignore: [stac_framework, movie_app]
ignore: [stac_framework, movie_app, stac_logger]
5 changes: 5 additions & 0 deletions packages/stac_logger/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.0

* Add example for the logger
* Add WASM implementation for logger with improved documentation

## 1.0.0

* Initial release of the stac_logger package
36 changes: 36 additions & 0 deletions packages/stac_logger/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Getting started

Add the package to your `pubspec.yaml`:

```yaml
dependencies:
stac_logger: ^1.0.0
```

Then run:

```bash
flutter pub get
```

## Usage

Import the package and use the `Log` class to log messages:

```dart
import 'package:stac_logger/stac_logger.dart';

void main() {
// Log a debug message
Log.d('Debug message');

// Log an info message
Log.i('Info message');

// Log a warning message
Log.w('Warning message');

// Log an error message
Log.e('Error message');
}
```
19 changes: 17 additions & 2 deletions packages/stac_logger/lib/src/log.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import 'package:stac_logger/src/log_interface.dart';

import 'log_io.dart' // Default implementation for non-web platforms
if (dart.library.html) 'log_web.dart'; // Web/WASM implementation
import 'log_stub.dart'
if (dart.library.io) 'log_io.dart'
if (dart.library.html) 'log_web.dart'
if (dart.library.wasm) 'log_web.dart';

/// A reusable logging utility for the Stac framework.
///
/// Get Started
/// ```dart
/// import 'package:stac_logger/stac_logger.dart';
///
/// void main() {
/// Log.d('Hello World');
/// }
/// ```
///
/// For information about Stac, visit [Stac](https://github.com/StacDev/stac).

class Log {
const Log._();
Expand Down
3 changes: 3 additions & 0 deletions packages/stac_logger/lib/src/log_stub.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:stac_logger/src/log_interface.dart';

LogInterface createLogger() => throw UnimplementedError();
1 change: 1 addition & 0 deletions packages/stac_logger/lib/stac_logger.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// A reusable logging utility for the Stac framework.
library;

export 'src/log.dart';
2 changes: 1 addition & 1 deletion packages/stac_logger/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: stac_logger
description: A lightweight and reusable logging utility for the Stac framework.
version: 1.0.0
version: 1.1.0
homepage: https://github.com/StacDev/stac
repository: https://github.com/StacDev/stac/tree/dev/packages/stac_logger

Expand Down