-
Notifications
You must be signed in to change notification settings - Fork 408
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
3a5cbff
commit e597498
Showing
1 changed file
with
33 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:cli_util/cli_logging.dart'; | ||
|
||
export 'package:cli_util/cli_logging.dart' show Progress; | ||
|
||
/// Flutter Launcher Icons Logger | ||
class FLILogger { | ||
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 | ||
FLILogger(this.isVerbose) { | ||
final ansi = Ansi(Ansi.terminalSupportsAnsi); | ||
_logger = isVerbose ? Logger.verbose(ansi: ansi) : Logger.standard(ansi: ansi); | ||
} | ||
|
||
/// Logs error messages | ||
void error(Object? message) => _logger.stderr('⚠️' + message.toString()); | ||
|
||
/// prings to console if [isVerbose] is true | ||
void verbose(Object? message) => _logger.trace(message.toString()); | ||
|
||
void info(Object? message) => _logger.stdout(message.toString()); | ||
|
||
/// Shows progress in console | ||
Progress progress(String message) => _logger.progress(message); | ||
} |