aharren / LibComponentLogging-Core

A small logging library for Objective-C applications (Mac OS X and iPhone OS/iOS) which provides conditional logging based on log levels and log components. Additionally, different logging strategies can be used, e.g. writing log messages to a file or sending them to the system log, while using the same logging interface.
http://0xc0.de/LibComponentLogging
110 stars 11 forks source link

Prefixes not recognised when lcl is used in sub-project #18

Closed Undistraction closed 11 years ago

Undistraction commented 12 years ago

I am using RestKit in a project as a sub-project of my main Xcode project. Restkit uses LibComponentLogging, setting up components, logger and extensions and compiling the necessary classes. I have Restkit set up as a dependency in my Main project's build target and can use the macros it generates to log events relevant to the framework.

I would like to use LibComponentLogging for my main project, but I cannot get my own Components to be recognised:

In lcl_config_components.h: _lcl_component(EL_F_COMMANDS, "Echo.flow.commands", "Echo/Flow/Commands")

But I get no code completion for: lcl_log(lcl_cEL_F_COMMANDS, lcl_vInfo, @"Command Executed"); and I get the compilation error: 'Use of undeclared identifier '__lcl_log_symbol_lcl_c'

I fully understand this isn't an issue with the framework, but is there anything you can recommend? I have tried closing Xcode and touching the config files but that hasn't helped. Is it the case that the framework has already processed the config for Restkit and so doesn't process my own config files?

aharren commented 12 years ago

Hi Pedr,

can you check if the code completion works for lcl_cRestKitNetwork ?

I assume that your lcl_config_components.h is ignored, and the one from RestKit is used instead.

The only workaround I see here is to add your components to the lcl_config_components.h file in RestKit.

Best regards, Arne

Undistraction commented 12 years ago

Hi Arne,

Yep. All the Restkit components are available, so that'll work. Thanks for the swift reply.

aharren commented 12 years ago

OK, I'll keep this issue open to have a reminder for it.

aharren commented 12 years ago

Related issue in RestKit: https://github.com/RestKit/RestKit/issues/914

aharren commented 11 years ago

RestKit 0.20 now uses an embedded variant of LibComponentLogging which should solve this problem.

When used with CocoaPods and the LibComponentLogging-pods pod, all RestKit log components will be integrated into the normal lcl_ symbol space. Otherwise, all RestKit components are prefixed with RK.