Defines

LoggerObjC.h File Reference

#include "Logger.h"

Go to the source code of this file.

Defines

#define LoggerObjC_LogEvent(logger, priority, keyword, subkeyword, text,...)
 This is Logger_LogEvent except that it allows for Objective-C %@, and any other Obj-C-isms that I may not be aware of.
#define LoggerObjC_LogEventv(logger, priority, keyword, subkeyword, text, argp)
 This is the va_list version of LoggerObjC_LogEvent.

Define Documentation

#define LoggerObjC_LogEvent (   logger,
  priority,
  keyword,
  subkeyword,
  text,
  ... 
)
Value:
{ \
        NSString* the_string = [[NSString alloc] initWithFormat:text, __VA_ARGS__]; \
        int bytes_written = Logger_LogEventNoFormat(logger, priority, keyword, subkeyword, [the_string UTF8String]); \
        [the_string release]; \
        return bytes_written; \
}

This is Logger_LogEvent except that it allows for Objective-C %@, and any other Obj-C-isms that I may not be aware of.

Parameters:
loggerThe logger instance you want to log with.
priorityThe priority allows the entry to be filtered by threshold. Higher numbers are higher priority. If the priority is higher than the logger's current threshold, the message will be printed 1 = lowest (least important) Highest will be determined by your team's conventions. For SClone, 5 = highest. Priority 0 is a special value. 0 will automatically get remapped to the logger's current Default Priorty. This gives you a little flexibilty if you want to be able to reassign a priority level later.
keywordThe keyword is the first identifying string to help classification. The keyword is intended to help automated tools in their parsing of logs. Your team should decide on a good convention for keywords. Logger will always append a colon after the keyword. My recommendation (though not required) is that keywords are always exactly one word with no spaces. Alpha-numeric is the best thing you can do. This helps make logs easy to parse.
subkeywordLike the keyword, the subkeyword is another identifier string to help you classify events. Once again, it is up to your team to decide on a good set of subkeywords. Single word, alphanumeric format is recommended. A colon will always be appended to the keyword.
textThis is where your message text goes. It is compatible with printf style format strings. There is no imposed limit on how long the strings can be or what the format of your message should be. The only constraint is that you should never have an END: on it's own line as this is the marker that Logger uses to denote the end of a log event. (Parsing tools and people could get confused.)
...This is the variable argument list used to accomodate printf style format strings.
Returns:
Returns the number of bytes written to the log. This conforms with fprintf.
See also:
Logger_LogEvent
#define LoggerObjC_LogEventv (   logger,
  priority,
  keyword,
  subkeyword,
  text,
  argp 
)
Value:
{ \
        NSString* the_string = [[NSString alloc] initWithFormat:text arguments:argp]; \
        Logger_LogEventNoFormat(logger, priority, keyword, subkeyword, [the_string UTF8String]); \
        [the_string release]; \
        return bytes_written; \
}

This is the va_list version of LoggerObjC_LogEvent.

The same rules apply to this as with LoggerObjC_LogEvent.

See also:
Logger_LogEventv, LoggerObjC_LogEvent
 All Data Structures Files Functions Variables Defines