log.dart 918 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import 'package:flutter/material.dart';
  2. // ignore: constant_identifier_names
  3. const DART_LOG = "Dart_LOG";
  4. class Log {
  5. static const enableLog = false;
  6. static void info(String? message) {
  7. if (enableLog) {
  8. debugPrint('AppFlowyBoard: ℹ️[Info]=> $message');
  9. }
  10. }
  11. static void debug(String? message) {
  12. if (enableLog) {
  13. debugPrint(
  14. 'AppFlowyBoard: 🐛[Debug] - ${DateTime.now().second}=> $message');
  15. }
  16. }
  17. static void warn(String? message) {
  18. if (enableLog) {
  19. debugPrint(
  20. 'AppFlowyBoard: 🐛[Warn] - ${DateTime.now().second} => $message');
  21. }
  22. }
  23. static void trace(String? message) {
  24. if (enableLog) {
  25. debugPrint(
  26. 'AppFlowyBoard: ❗️[Trace] - ${DateTime.now().second}=> $message');
  27. }
  28. }
  29. static void error(String? message) {
  30. debugPrint('AppFlowyBoard: ❌[Error] - ${DateTime.now().second}=> $message');
  31. }
  32. }