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

Add a helper macro for tracing method invocations #13

Closed vocaro closed 13 years ago

vocaro commented 13 years ago

We have been using LibComponentLogging in our app, and we often found ourselves writing commands like:

lcl_log(MyComponent, lcl_vTrace, @"")

It is convenient for tracing method invocations but is a bit verbose. This macro reduces the call to a single parameter.

aharren commented 13 years ago

Hi Trevor,

did you try the qlog extension? https://github.com/aharren/LibComponentLogging-qlog

It even allows you to write a more compact version for tracing method invocations: qltrace(); qltrace(@"%d", some_number);

If you don't like the file-global log component which is used by qlog, I can also add versions of the macros which require a log component, e.g.

qltrace_c(MyComponent); qltrace_c(MyComponent, @"%d", some_number);

While working on issue #10, I decided to not include additional logging macros into the Core part of the library. That's why these macros are in the qlog project.

Best regards, Arne

vocaro commented 13 years ago

No, I didn't notice qlog before. But I wish it had an option to take the component as a parameter instead of having to define it elsewhere.

aharren commented 13 years ago

OK, I'll add additional macros to qlog which take the component as an argument.

aharren commented 13 years ago

Hi Trevor, please take a look at the latest files in the devel branch: https://github.com/aharren/LibComponentLogging-qlog/tree/devel Best regards, Arne

aharren commented 13 years ago

Hi Trevor, I've pushed the new files to the master branch of qlog. New tag is 1.0.2. Best regards, Arne