Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log problem #33

Closed
sujiewen opened this issue Sep 1, 2018 · 6 comments
Closed

log problem #33

sujiewen opened this issue Sep 1, 2018 · 6 comments

Comments

@sujiewen
Copy link

sujiewen commented Sep 1, 2018

我的引用代码:

#ifdef DEBUG
#define LRString [NSString stringWithFormat:@"%s", __FILE__].lastPathComponent
#define NSLog(fmt, ...) [CocoaDebug objcLog:[[NSString stringWithUTF8String:__FILE__] lastPathComponent] :NSStringFromSelector(_cmd) :__LINE__ :(fmt, ##__VA_ARGS__) :[UIColor whiteColor]]
#else
static const DDLogLevel ddLogLevel = DDLogLevelWarning;
#if defined(OM_BETA) || defined(OM_TEST)
#define NSLog(fmt, ...) [CocoaDebug objcLog:[[NSString stringWithUTF8String:__FILE__] lastPathComponent] :NSStringFromSelector(_cmd) :__LINE__ :(fmt, ##__VA_ARGS__) :[UIColor whiteColor]]
#else
#define NSLog DDLogError
#endif

#endif

#endif

报错:
Controller/AddTimeApplyController.m:446:9: error: sending 'CGFloat' (aka 'double') to parameter of incompatible type 'id _Nonnull'
NSLog(@"%f",progress);

//////////////////////////////////////////////////////////////////

NSLog(""),里面必须是NSString?

@sujiewen
Copy link
Author

sujiewen commented Sep 1, 2018

应该是不能出现基本类型

NSLog(@"%f",progress); 报错

NSLog(@"%@",@“222”);对

@CocoaDebug
Copy link
Owner

建议你参考下我的Objective-C的示例项目,没有出现这种情况。应该是NSLog宏定义的问题。

@CocoaDebug CocoaDebug added the help wanted Extra attention is needed label Sep 4, 2018
@sujiewen
Copy link
Author

sujiewen commented Sep 5, 2018

demo也有这个问题

@CocoaDebug CocoaDebug reopened this Sep 10, 2018
@CocoaDebug
Copy link
Owner

好的,我check一下

@CocoaDebug
Copy link
Owner

确实Objective-C的demo也有此问题,swift的demo暂无问题。

暂时没有好的解决方案,欢迎大家提PR

@CocoaDebug CocoaDebug added bug Something isn't working and removed help wanted Extra attention is needed labels Sep 19, 2018
@CocoaDebug CocoaDebug added enhancement New feature or request and removed bug Something isn't working labels Nov 4, 2018
@CocoaDebug
Copy link
Owner

CocoaDebug commented Dec 16, 2018

Please update CocoaDebug to last version. Thanks!

@CocoaDebug CocoaDebug removed the enhancement New feature or request label Apr 2, 2019
@CocoaDebug CocoaDebug changed the title 日志打印的问题 log problem Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants