ORKJSONLogFormatter Class Reference

Inherits from ORKLogFormatter : NSObject
Declared in ORKDataLogger.h
ORKDataLogger.m

Overview

The ORKJSONLogFormatter class represents a log formatter for producing JSON output.

The JSON log formatter accepts NSDictionary objects for serialization. The JSON output is a dictionary that contains one key, items, which contains the array of logged items. The log itself does not contain any timestamp information, so the items should include such fields, if desired.

– canAcceptLogObjectOfClass:

Returns a Boolean value that indicates whether the log formatter can serialize the specified type of object.

- (BOOL)canAcceptLogObjectOfClass:(Class)c

Parameters

c

The class of object to serialize.

Return Value

YES if the log formatter can serialize this object class; otherwise, NO.

Declared In

ORKDataLogger.h

– canAcceptLogObject:

Returns a Boolean value that indicates whether the log formatter can serialize the specified type of object.

- (BOOL)canAcceptLogObject:(id)object

Parameters

object

The object to serialize.

Return Value

YES if the log formatter can serialize object; otherwise, NO

Declared In

ORKDataLogger.h

– beginLogWithFileHandle:error:

Begins a new log file on the specified file handle.

- (BOOL)beginLogWithFileHandle:(NSFileHandle *)fileHandle error:(NSError **)error

Parameters

fileHandle

The file handle to which to write.

error

The error output, on failure.

Return Value

YES if the write succeeds; otherwise, NO.

Discussion

For example, may write a header or opening stanza of a new log file.

Declared In

ORKDataLogger.h

– appendObject:fileHandle:error:

Appends the specified object to the log file.

- (BOOL)appendObject:(id)object fileHandle:(NSFileHandle *)fileHandle error:(NSError **)error

Parameters

object

The object to write.

fileHandle

The file handle to which to write.

error

The error output, on failure.

Return Value

YES if the write succeeds; otherwise, NO.

Declared In

ORKDataLogger.h

– appendObjects:fileHandle:error:

Appends the specified objects to the log file.

- (BOOL)appendObjects:(NSArray *)objects fileHandle:(NSFileHandle *)fileHandle error:(NSError *__autoreleasing *)error

Parameters

objects

The objects to write.

fileHandle

The file handle to which to write.

error

The error output, on failure.

Return Value

YES if the write succeeds; otherwise, NO.

Declared In

ORKDataLogger.h