Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'LOG_INFO' macro redefined warning after moved project to swift bridging project

I got several warnings like these:

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

The warning complains about DDLog.h in the Projet-Bridging-Header.h

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

How can I get around this issue?

like image 359
angelokh Avatar asked Sep 24 '14 18:09

angelokh


1 Answers

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

If your Swift code doesn't need the syslog constants, you should be able to undefine them before importing DDLog.h to get rid of the warning.

#undef LOG_INFO
#undef LOG_DEBUG
#import "DDlog.h"
like image 68
nschum Avatar answered Oct 03 '22 07:10

nschum