-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Showing
8 changed files
with
47 additions
and
33 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
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 |
---|---|---|
@@ -1,25 +1,18 @@ | ||
import 'package:logging/logging.dart'; | ||
|
||
/// Used to print console messages with the flutter_i18n prefix | ||
class MessagePrinter { | ||
static bool _mustPrintMessage = false; | ||
|
||
static setMustPrintMessage(bool mustPrintMessage) => | ||
_mustPrintMessage = mustPrintMessage; | ||
static final logger = Logger("flutter_i18n"); | ||
|
||
static debug(final String message) { | ||
_printMessage("DEBUG", message); | ||
logger.fine(message); | ||
} | ||
|
||
static info(final String message) { | ||
_printMessage("INFO", message); | ||
logger.info(message); | ||
} | ||
|
||
static error(final String message) { | ||
_printMessage("ERROR", message); | ||
} | ||
|
||
static _printMessage(final String prefix, final String message) { | ||
if (_mustPrintMessage) { | ||
print("[flutter_i18n $prefix]: $message"); | ||
} | ||
logger.shout(message); | ||
} | ||
} |
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