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
26 changes: 0 additions & 26 deletions packages/stac_cli/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flutter:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client:
dependency: transitive
description:
Expand Down Expand Up @@ -358,14 +353,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.13.0"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -462,11 +449,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
source_gen:
dependency: transitive
description:
Expand Down Expand Up @@ -601,14 +583,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.0"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.2.0"
vm_service:
dependency: transitive
description:
Expand Down
31 changes: 22 additions & 9 deletions packages/stac_logger/lib/src/log_web.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import 'package:flutter/foundation.dart';
import 'package:stac_logger/src/log_interface.dart';

LogInterface createLogger() => LogWeb.instance;

/// Whether the app is running in debug mode.
///
/// This is a pure Dart equivalent of Flutter's `kDebugMode`.
/// It evaluates to `true` when assertions are enabled (debug mode)
/// and `false` in release/profile mode.
final bool _kDebugMode = () {
var isDebug = false;
assert(() {
isDebug = true;
return true;
}());
return isDebug;
}();

/// Web/WASM-compatible implementation of LogInterface
class LogWeb implements LogInterface {
LogWeb._();
Expand All @@ -12,29 +25,29 @@ class LogWeb implements LogInterface {

@override
void d(dynamic message) {
if (kDebugMode) {
debugPrint('[DEBUG] $message');
if (_kDebugMode) {
print('[DEBUG] $message');
}
}

@override
void i(dynamic message) {
if (kDebugMode) {
debugPrint('[INFO] $message');
if (_kDebugMode) {
print('[INFO] $message');
}
}

@override
void w(dynamic message) {
if (kDebugMode) {
debugPrint('[WARNING] $message');
if (_kDebugMode) {
print('[WARNING] $message');
}
}

@override
void e(dynamic message) {
if (kDebugMode) {
debugPrint('[ERROR] $message');
if (_kDebugMode) {
print('[ERROR] $message');
}
}
}
45 changes: 2 additions & 43 deletions packages/stac_logger/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,10 @@ repository: https://github.com/StacDev/stac/tree/dev/packages/stac_logger

environment:
sdk: ^3.8.1
flutter: ">=1.17.0"

dependencies:
flutter:
sdk: flutter
logger: ^2.5.0

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/to/asset-from-package
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images

# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/to/font-from-package
test: ^1.24.0
lints: ^6.0.0
Loading