RSDRecordSampleLogger
public class RSDRecordSampleLogger : RSDDataLogger
RSDRecordSampleLogger is used to write samples encoded as json dictionary objects to a logging file.
-
Errors that can be thrown by the logger.
See moreDeclaration
Swift
public enum RSDRecordSampleLoggerError : Error -
Is the root element in the json file a dictionary?
Declaration
Swift
public let usesRootDictionary: Bool -
Default initializer. The initializer will automatically open the file and write the JSON root element and start the sample array.
Declaration
Swift
public init(identifier: String, url: URL, usesRootDictionary: Bool) throwsParameters
identifierA unique identifier for the logger.
urlThe url to the file.
usesRootDictionaryIs the root element in the json file a dictionary?
-
Write multiple samples to the logger.
Throws
Error if writing the samples fails because the wasn’t enough memory on the device.Declaration
Swift
public func writeSamples(_ samples: [RSDSampleRecord]) throwsParameters
samplesThe samples to add to the logging file.
-
Write a sample to the logger.
Throws
Error if writing the sample fails because the wasn’t enough memory on the device.Declaration
Swift
public func writeSample(_ sample: RSDSampleRecord) throwsParameters
sampleThe sample to add to the logging file.
-
Close the file. This will write the end tag for the root element and then close the file handle. If there is an error thrown by writing the closing tag, then the file handle will be closed and the error will be rethrown.
Throws
Error thrown when attempting to write the closing tag.Declaration
Swift
public override func close() throws
View on GitHub
RSDRecordSampleLogger Class Reference