我正在将使用 Lumberjack Logging 的 Objective-C 文件转换为 Swift。除了我声明的部分之外,它似乎大部分都在工作ddloglevel
。
执行此操作的 Objective-C 方法:
#ifdef DEBUG
static const int ddLogLevel = LOG_LEVEL_INFO;
#else
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
#endif
迅速的方式:
#if DEBUG
let ddLogLevel = LOG_LEVEL_INFO;
#else
let ddLogLevel = LOG_LEVEL_VERBOSE;
#endif
除了我是这个编译时错误: Use of unresolved identifier 'LOG_LEVEL_INFO'
为什么会这样?我该如何解决?