Skip to content

Commit

Permalink
release 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chenenyu committed May 20, 2021
1 parent e73e178 commit dcf7571
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 37,043 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ pubspec.lock
build/

log.txt
tool/*.txt
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.3.2] - 2021/05/20

* Add constructor parameter `supportsAnsiColor` for `ConsoleEmitter`.

## [1.3.1] - 2020/11/26

* Upgrade `ansicolor` version to auto detect whether ANSI is supported.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020 chenenyu
Copyright 2021 chenenyu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ Dog.level = Level.OFF;

[`FileEmitter`](lib/src/emitter/file_formatter.dart): Output message to file, it doesn't support web platform.

## Note

If you are running a flutter app by **AndroidStudio** and the console log is not colorful, then try to enable it manually:
```dart
dog = Dog(emitter: ConsoleEmitter(supportsAnsiColor: true));
```

## Thanks

[logger](https://github.com/orhanobut/logger): Logger for android.
6 changes: 6 additions & 0 deletions lib/src/emitter/console_emitter_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class ConsoleEmitter extends Emitter {

final AnsiPen pen = AnsiPen();

ConsoleEmitter({bool supportsAnsiColor}) {
if (supportsAnsiColor != null) {
ansiColorDisabled = !supportsAnsiColor;
}
}

@override
void emit(Record record, List<String> lines) {
pen.reset();
Expand Down
2 changes: 2 additions & 0 deletions lib/src/emitter/console_emitter_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import '../record.dart';

/// Print to browser console.
class ConsoleEmitter extends Emitter {
ConsoleEmitter({bool supportsAnsiColor});

@override
void emit(Record record, List<String> lines) {
String output = lines.join('\n');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dog
description: Simple and pretty log package for Dart, includes Flutter and web.
version: 1.3.1
version: 1.3.2
repository: https://github.com/chenenyu/dog
publish_to: https://pub.dev

Expand Down
2,522 changes: 0 additions & 2,522 deletions tool/EastAsianWidth.txt

This file was deleted.

33,797 changes: 0 additions & 33,797 deletions tool/UnicodeData.txt

This file was deleted.

722 changes: 0 additions & 722 deletions tool/emoji-data.txt

This file was deleted.

0 comments on commit dcf7571

Please sign in to comment.