log_level.dart 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2019 Taner Sener
  3. *
  4. * This file is part of FlutterFFmpeg.
  5. *
  6. * FlutterFFmpeg is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * FlutterFFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with FlutterFFmpeg. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. class LogLevel {
  20. /// Print no output.
  21. static const int AV_LOG_QUIET = -8;
  22. /// Something went really wrong and we will crash now.
  23. static const int AV_LOG_PANIC = 0;
  24. /// Something went wrong and recovery is not possible.
  25. /// For example, no header was found for a format which depends
  26. /// on headers or an illegal combination of parameters is used.
  27. static const int AV_LOG_FATAL = 8;
  28. /// Something went wrong and cannot losslessly be recovered.
  29. /// However, not all future data is affected.
  30. static const int AV_LOG_ERROR = 16;
  31. /// Something somehow does not look correct. This may or may not
  32. /// lead to problems. An example would be the use of '-vstrict -2'.
  33. static const int AV_LOG_WARNING = 24;
  34. /// int Standard information.
  35. static const int AV_LOG_INFO = 32;
  36. /// Detailed information.
  37. static const int AV_LOG_VERBOSE = 40;
  38. /// Stuff which is only useful for libav* developers.
  39. static const int AV_LOG_DEBUG = 48;
  40. /// Extremely verbose debugging, useful for libav* development.
  41. static const int AV_LOG_TRACE = 56;
  42. /// Returns log level string from int
  43. static String levelToString(int level) {
  44. switch (level) {
  45. case LogLevel.AV_LOG_TRACE:
  46. return "TRACE";
  47. case LogLevel.AV_LOG_DEBUG:
  48. return "DEBUG";
  49. case LogLevel.AV_LOG_VERBOSE:
  50. return "VERBOSE";
  51. case LogLevel.AV_LOG_INFO:
  52. return "INFO";
  53. case LogLevel.AV_LOG_WARNING:
  54. return "WARNING";
  55. case LogLevel.AV_LOG_ERROR:
  56. return "ERROR";
  57. case LogLevel.AV_LOG_FATAL:
  58. return "FATAL";
  59. case LogLevel.AV_LOG_PANIC:
  60. return "PANIC";
  61. case LogLevel.AV_LOG_QUIET:
  62. default:
  63. return "";
  64. }
  65. }
  66. }