Updated angel3-orm

This commit is contained in:
thomashii 2021-06-14 08:08:25 +08:00
parent 9eb81a541d
commit a32652b683
6 changed files with 8 additions and 45 deletions

View file

@ -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';

View file

@ -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';

View file

@ -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';

View file

@ -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;
}

View file

@ -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

View file

@ -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';