DRM decrypting tool for Samsung TVs PVR
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

trace.h 778B

12345678910111213141516171819202122232425262728
  1. /* drmdecrypt -- DRM decrypting tool for Samsung TVs
  2. *
  3. * Copyright (C) 2014 - Bernhard Froehlich <decke@bluelife.at>
  4. * All rights reserved.
  5. *
  6. * This software may be modified and distributed under the terms
  7. * of the GPL v2 license. See the LICENSE file for details.
  8. */
  9. enum {
  10. TRC_DEBUG = 0,
  11. TRC_INFO,
  12. TRC_WARN,
  13. TRC_ERROR
  14. };
  15. static int tracelevel = TRC_INFO;
  16. #define trace(L, M, ...) \
  17. if(L >= tracelevel) { \
  18. if (tracelevel == 0) { \
  19. fprintf(stderr, "%s %s:%d: " M "\n", L == 0 ? "DEBUG" : L == 1 ? "INFO" : L == 2 ? "WARN" : "ERROR", __FILE__, __LINE__, ##__VA_ARGS__); \
  20. } \
  21. else { \
  22. fprintf(stderr, "%s " M "\n", L == 0 ? "DEBUG" : L == 1 ? "INFO" : L == 2 ? "WARN" : "ERROR", ##__VA_ARGS__); \
  23. } \
  24. }