diff --git a/bin/dev.dart b/bin/dev.dart index 2c5c06a..26a4d0e 100644 --- a/bin/dev.dart +++ b/bin/dev.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:angel3_app/src/pretty_logging.dart'; -import 'package:angel3_app/angel.dart'; +import 'package:angel/angel.dart'; +import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:angel3_container/mirrors.dart'; import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_hot/angel3_hot.dart'; diff --git a/bin/migrate.dart b/bin/migrate.dart index f9a17ee..755ffe3 100644 --- a/bin/migrate.dart +++ b/bin/migrate.dart @@ -1,5 +1,5 @@ -import 'package:angel3_app/src/config/plugins/orm.dart'; -import 'package:angel3_app/models.dart'; +import 'package:angel/src/config/plugins/orm.dart'; +import 'package:angel/models.dart'; import 'package:angel3_configuration/angel3_configuration.dart'; import 'package:angel3_migration_runner/angel3_migration_runner.dart'; import 'package:angel3_migration_runner/postgres.dart'; diff --git a/bin/prod.dart b/bin/prod.dart index a0b972b..efd1e5e 100644 --- a/bin/prod.dart +++ b/bin/prod.dart @@ -1,4 +1,4 @@ -import 'package:angel3_app/angel.dart'; +import 'package:angel/angel.dart'; import 'package:angel3_container/mirrors.dart'; import 'package:angel3_production/angel3_production.dart'; diff --git a/lib/src/pretty_logging.dart b/lib/src/pretty_logging.dart deleted file mode 100644 index eb1e905..0000000 --- a/lib/src/pretty_logging.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:angel3_http_exception/angel3_http_exception.dart'; -import 'package:logging/logging.dart'; -import 'package:io/ansi.dart'; - -/// Prints the contents of a [LogRecord] with pretty colors. -void prettyLog(LogRecord record) { - var code = chooseLogColor(record.level); - - if (record.error == null) print(code.wrap(record.toString())); - - if (record.error != null) { - var err = record.error; - if (err is AngelHttpException && err.statusCode != 500) return; - print(code.wrap(record.toString() + '\n')); - print(code.wrap(err.toString())); - - if (record.stackTrace != null) { - print(code.wrap(record.stackTrace.toString())); - } - } -} - -/// Chooses a color based on the logger [level]. -AnsiCode chooseLogColor(Level level) { - if (level == Level.SHOUT) { - return backgroundRed; - } else if (level == Level.SEVERE) { - return red; - } else if (level == Level.WARNING) { - return yellow; - } else if (level == Level.INFO) { - return cyan; - } else if (level == Level.CONFIG || - level == Level.FINE || - level == Level.FINER || - level == Level.FINEST) return lightGray; - return resetAll; -} diff --git a/pubspec.yaml b/pubspec.yaml index 80ebc3b..0a8be2d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: angel3_app +name: angel version: 1.0.0 description: A boilerplate template for building Angel3 application with ORM enabled publish_to: none @@ -17,6 +17,7 @@ dependencies: angel3_production: ^3.0.0 angel3_static: ^4.0.0 angel3_validate: ^4.0.0 + angel3_pretty_logging: ^3.0.0 optional: ^6.0.0-nullsafety.2 dev_dependencies: angel3_hot: ^4.0.0 diff --git a/test/all_test.dart b/test/all_test.dart index d6074c0..445c2d9 100644 --- a/test/all_test.dart +++ b/test/all_test.dart @@ -1,4 +1,4 @@ -import 'package:angel3_app/angel.dart'; +import 'package:angel/angel.dart'; import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_test/angel3_test.dart'; import 'package:test/test.dart';