-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9e54bc
commit e0481f3
Showing
13 changed files
with
107 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ analysis_benchmark.json | |
.packages | ||
.pub-preload-cache/ | ||
.pub/ | ||
*.lock | ||
build/ | ||
flutter_*.png | ||
linked_*.ds | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:logger/logger.dart'; | ||
|
||
NRFLogger? logger; | ||
|
||
/// Flutter Launcher Icons Logger | ||
class NRFLogger { | ||
late Logger _logger; | ||
|
||
/// Returns true if this is a verbose logger | ||
final bool isVerbose; | ||
|
||
/// Gives access to internal logger | ||
Logger get rawLogger => _logger; | ||
|
||
/// Creates a instance of [FLILogger]. | ||
/// In case [isVerbose] is `true`, | ||
/// it logs all the [verbose] logs to console | ||
NRFLogger(this.isVerbose) { | ||
_logger = Logger( | ||
printer: PrettyPrinter( | ||
methodCount: 2, // Number of method calls to be displayed | ||
errorMethodCount: 8, // Number of method calls if stacktrace is provided | ||
lineLength: 120, // Width of the output | ||
colors: true, // Colorful log messages | ||
printEmojis: true, // Print an emoji for each log message | ||
printTime: true // Should each log print contain a timestamp | ||
), | ||
level: Level.all | ||
); | ||
} | ||
|
||
/// Logs error messages | ||
void error(Object? message) => _logger.e('Error Log', error: '⚠️ $message'); | ||
|
||
/// Prints to console if [isVerbose] is true | ||
void verbose(Object? message){ | ||
if(isVerbose){ | ||
_logger.t(message.toString()); | ||
} | ||
} | ||
/// Prints to console if [isVerbose] is true | ||
void warning(Object? message) => _logger.w(message.toString()); | ||
/// Prints to console | ||
void info(Object? message) => _logger.i(message.toString()); | ||
} |
Oops, something went wrong.