File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
99//title~
1010
11+ import 'dart:math' ;
12+
1113import 'package:df_safer_dart/df_safer_dart.dart' show Here;
1214import 'package:meta/meta.dart' show visibleForTesting;
1315import 'dart:developer' as developer;
@@ -522,7 +524,8 @@ final class Log {
522524 // Maybe get the basepath.
523525 String ? location;
524526 if (includePath) {
525- location = _shortenedLocation (Here (initialStackLevel).location.orNull ());
527+ final frame = Here (max (0 , initialStackLevel - 1 )).call ().orNull ();
528+ location = _shortenedLocation (frame? .location, frame? .member);
526529 }
527530
528531 // Combine tags with the tag from category.
@@ -578,7 +581,7 @@ typedef Glog = Log;
578581
579582// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
580583
581- String ? _shortenedLocation (String ? location) {
584+ String ? _shortenedLocation (String ? location, String ? member ) {
582585 if (location == null ) {
583586 return null ;
584587 }
@@ -590,7 +593,7 @@ String? _shortenedLocation(String? location) {
590593 final package = path.split (':' )[1 ].split ('/' ).first;
591594 return '$package :$file #$line ' ;
592595 } else {
593- return '$file #$line ' ;
596+ return '$file /$ member #$line ' ;
594597 }
595598}
596599// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ repository: https://github.com/robmllze/df_log
1616funding :
1717 - https://www.buymeacoffee.com/dev_cetera
1818description : A package that provides logging utilities for better debugging.
19- version : 0.3.18
19+ version : 0.3.19
2020topics :
2121 - console
2222 - debugging
@@ -33,12 +33,14 @@ environment:
3333
3434dependencies :
3535 path : ^1.9.1
36- df_safer_dart : ^0.15 .2
36+ df_safer_dart : ^0.16 .2
3737 uuid : ^4.5.1
3838 meta : ^1.16.0
3939
4040# # -----------------------------------------------------------------------------
4141
4242dev_dependencies :
4343 lints : ^6.0.0
44+ custom_lint : ^0.7.5
45+ df_safer_dart_lints : ^0.3.2
4446
You can’t perform that action at this time.
0 commit comments