Skip to content

Commit 9c92fc2

Browse files
committed
+Minor tweaks
1 parent 303a1dc commit 9c92fc2

File tree

6 files changed

+36
-41
lines changed

6 files changed

+36
-41
lines changed

analysis_options.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
##.title
2-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3-
##
4-
## Copyright © dev-cetera.com & contributors.
5-
##
6-
## The use of this source code is governed by an MIT-style license described in
7-
## the LICENSE file located in this project's root directory.
8-
##
9-
## See: https://opensource.org/license/mit
10-
##
11-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
12-
##.title~
1+
# Dev-Cetera analysis_options.yaml for Dart - Version 1
132

143
include: package:lints/recommended.yaml
154

@@ -20,6 +9,7 @@ linter:
209
avoid_web_libraries_in_flutter: true
2110
camel_case_types: false
2211
constant_identifier_names: false
12+
directives_ordering: true
2313
file_names: false
2414
library_private_types_in_public_api: false
2515
non_constant_identifier_names: false
@@ -29,8 +19,8 @@ linter:
2919
prefer_final_fields: true
3020
prefer_function_declarations_over_variables: false
3121
prefer_relative_imports: true
32-
prefer_single_quotes: true
3322
require_trailing_commas: true
23+
unawaited_futures: true
3424
unnecessary_this: true
3525

3626
analyzer:
@@ -44,7 +34,6 @@ analyzer:
4434
- build/**
4535

4636
errors:
47-
unused_label: ignore
4837
always_declare_return_types: error
4938
avoid_renaming_method_parameters: error
5039
avoid_type_to_string: error
@@ -55,8 +44,14 @@ analyzer:
5544
no_leading_underscores_for_local_identifiers: error
5645
prefer_final_in_for_each: error
5746
prefer_relative_imports: error
47+
prefer_single_quotes: error
48+
unnecessary_async: error
49+
unnecessary_await_in_return: error
50+
unnecessary_late: error
5851
unnecessary_new: error
52+
unnecessary_unawaited: error
5953
unrelated_type_equality_checks: error
54+
unused_label: ignore
6055
use_key_in_widget_constructors: error
6156

6257
formatter:

lib/_common.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1212
//.title~
1313

14+
export 'dart:collection' show Queue;
15+
export 'dart:convert' show JsonEncoder;
1416
export 'dart:math' show max;
15-
export 'package:stack_trace/stack_trace.dart' show Frame;
17+
1618
export 'package:df_safer_dart/df_safer_dart.dart' show Here;
1719
export 'package:meta/meta.dart' show visibleForTesting;
18-
export 'dart:collection' show Queue;
19-
export 'dart:convert' show JsonEncoder;
20+
export 'package:stack_trace/stack_trace.dart' show Frame;
2021
export 'package:uuid/uuid.dart' show Uuid;
2122

2223
export 'src/_src.g.dart';

lib/src/_src.g.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
88
//.title~
99

10+
// ignore_for_file: directives_ordering
11+
1012
export './ansi_styled_string.dart';
1113
export './log.dart';
14+
export './log_item.dart';

lib/src/log.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import 'dart:developer' as developer;
1212

1313
import '/_common.dart';
1414

15-
import '_log_item.dart';
16-
1715
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
1816

1917
final class Log {
Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ final class LogItem {
5555
required this.showTags,
5656
required this.showTimestamp,
5757
required this.frame,
58-
}) : id = const Uuid().v4(),
59-
timestamp = DateTime.now(),
60-
internalIndex = _internalCount++;
58+
}) : id = const Uuid().v4(),
59+
timestamp = DateTime.now(),
60+
internalIndex = _internalCount++;
6161

6262
//
6363
//
@@ -110,12 +110,10 @@ final class LogItem {
110110
final hasLocation = location1 != null && location1.isNotEmpty;
111111

112112
if (hasLocation) {
113-
final bracketStyle = nonMessageStyle != null
114-
? AnsiStyle.bold + nonMessageStyle
115-
: null;
116-
final pathTextStyle = nonMessageStyle != null
117-
? AnsiStyle.italic + nonMessageStyle
118-
: null;
113+
final bracketStyle =
114+
nonMessageStyle != null ? AnsiStyle.bold + nonMessageStyle : null;
115+
final pathTextStyle =
116+
nonMessageStyle != null ? AnsiStyle.italic + nonMessageStyle : null;
119117
if (icon != null) {
120118
buffer.write('$icon ');
121119
}
@@ -132,8 +130,8 @@ final class LogItem {
132130

133131
if (message != null) {
134132
final styledMessage = message.toString().trim().withAnsiStyle(
135-
messageStyle,
136-
);
133+
messageStyle,
134+
);
137135
buffer.write(styledMessage);
138136
}
139137

@@ -161,18 +159,19 @@ final class LogItem {
161159
final uri = frame?.uri.toString();
162160

163161
return {
162+
'id': id,
163+
'column': column,
164164
'icon': icon != null && (location != null && location!.isNotEmpty)
165165
? icon
166166
: null,
167-
'location': location != null && location!.isNotEmpty ? location : null,
168-
'message': message,
169-
'timestamp': timestamp.toIso8601String(),
170-
'tags': tags.isNotEmpty ? tags.map(_unmangleSymbol).toList() : null,
171-
'id': id,
172-
'column': column,
167+
'internalIndex': internalIndex,
168+
'library': library,
173169
'line': line,
170+
'location': location != null && location!.isNotEmpty ? location : null,
171+
'message': message?.toString(),
174172
'package': package,
175-
'library': library,
173+
'tags': tags.isNotEmpty ? tags.map(_unmangleSymbol).toList() : null,
174+
'timestamp': timestamp.toIso8601String(),
176175
'uri': uri,
177176
};
178177
}
@@ -183,9 +182,8 @@ final class LogItem {
183182

184183
String toJson({bool pretty = true}) {
185184
final map = toMap();
186-
final encoder = pretty
187-
? const JsonEncoder.withIndent(' ')
188-
: const JsonEncoder();
185+
final encoder =
186+
pretty ? const JsonEncoder.withIndent(' ') : const JsonEncoder();
189187
return encoder.convert(map);
190188
}
191189

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ funding:
2020
- https://github.com/sponsors/t0mb3rr
2121

2222
description: A package that provides logging utilities for better debugging.
23-
version: 0.3.29
23+
version: 0.3.30
2424
topics:
2525
- console
2626
- debugging

0 commit comments

Comments
 (0)