Macro definition of the overridden macro "LOG_INFO" after transferring a project to a quick bridge project

I got a few warnings:

Swift compiler warning: CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler /Myfolder/Pods/Headers/CocoaLumberjack/DDLog.h:176:9: 'LOG_INFO' macro redefined /Myfolder/Pods/Headers/CocoaLumberjack/DDLog.h:177:9: 'LOG_DEBUG' macro redefined 

Warning complains about DDLog.h in Projet-Bridging-Header.h

 #import "DDLog.h" #import "DDASLLogger.h" #import "DDTTYLogger.h" 

How can I get around this problem?

+5
source share
1 answer

The problem is that Swift automatically imports syslog.h , which defines constants with the same name.

If your SWIFT code does not need syslog constants, you should be able to define them before importing DDLog.h to get rid of the warning.

 #undef LOG_INFO #undef LOG_DEBUG #import "DDlog.h" 
+5
source

Source: https://habr.com/ru/post/1203319/


All Articles