洛阳学员端
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.

43 lines
1.5 KiB

9 months ago
  1. //
  2. // APBLogger.h
  3. // BioAuthEngine
  4. //
  5. // Created by yukun.tyk on 12/8/15.
  6. // Copyright © 2015 DTF. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <BioAuthEngine/APBConfig.h>
  10. extern NSString *const kDebugNotiName; //log信息发送的通知名称
  11. #define __FILE_NAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  12. #ifdef DEBUG //debug
  13. // std::cout<<"\n[BIOAUTH]:" << [[NSString stringWithFormat:fmt, ##__VA_ARGS__]cStringUsingEncoding:NSUTF8StringEncoding] \
  14. // <<", function:" << __PRETTY_FUNCTION__ << ", file:" << __FILE_NAME__ << ", line:" << __LINE__ << ", date:" << \
  15. // __DATE__ << ", time:" <<__TIME__<<std::endl;
  16. #define BIOAUTH_LOG(fmt, ...) \
  17. { \
  18. NSLog(@"[BIOAUTH]: %@, function:%s, file:%s, line:%d, date:%s, time:%s",\
  19. [NSString stringWithFormat:fmt, ##__VA_ARGS__], __PRETTY_FUNCTION__, __FILE_NAME__, __LINE__, __DATE__, __TIME__);\
  20. }
  21. #define LOG_DBG(fmt, ...) BIOAUTH_LOG(fmt, ##__VA_ARGS__);
  22. #define LOG_INFO(fmt, ...) BIOAUTH_LOG(fmt, ##__VA_ARGS__);
  23. #define LOG_ERROR(fmt, ...) BIOAUTH_LOG(fmt, ##__VA_ARGS__);
  24. #else //release
  25. #define LOG_DBG(fmt, ...)
  26. #define LOG_INFO(fmt, ...)
  27. #define LOG_ERROR(fmt, ...)
  28. #endif