FMLiveSwitchTextLogProvider Class Reference

Simple log provider that writes to a local string builder. More...

Instance Methods

(FMLiveSwitchAction1< NSString * > *) - callback
 Gets a callback to invoke whenever text is written to the log. More...
 
(NSString *) - clear
 Clears all text from the log and returns the former contents. More...
 
(void) - doLogWithLogEvent:
 Logs a message at the specified log level. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchTextLogProvider. More...
 
(instancetype) - initWithLevel:
 Initializes a new instance of the FMLiveSwitchTextLogProvider class. More...
 
(void) - setCallback:
 Sets a callback to invoke whenever text is written to the log. More...
 
(NSString *) - setCallbackBlock
 Sets a callback to invoke whenever text is written to the log. More...
 
(void) - setCallbackBlock:
 Sets a callback to invoke whenever text is written to the log. More...
 
(NSString *) - text
 Gets the logged text. More...
 
- Instance Methods inherited from FMLiveSwitchLogProvider
(FMLiveSwitchFunction1< FMLiveSwitchLogEvent *, id > *) - filter
 Gets a filter on the log provider. More...
 
(NSString *) - generateLogLineWithLogEvent:
 Generates a default log line. More...
 
(NSString *) - getPrefixWithLevel:includeTimestamp:
 Converts a log-level to a 5-character string for consistently-spaced character sequences. More...
 
(FMLiveSwitchLogLevel) - level
 Gets the log level. More...
 
(void) - logWithLogEvent:
 Log a message. More...
 
(int) - processId
 Gets the current process id. More...
 
(void) - setFilter:
 Sets a filter on the log provider. More...
 
(FMLiveSwitchLogEvent *) - setFilterBlock
 Sets a filter on the log provider. More...
 
(void) - setFilterBlock:
 Sets a filter on the log provider. More...
 
(void) - setLevel:
 Sets the log level. More...
 

Class Methods

(FMLiveSwitchTextLogProvider *) + textLogProvider
 Initializes a new instance of the FMLiveSwitchTextLogProvider. More...
 
(FMLiveSwitchTextLogProvider *) + textLogProviderWithLevel:
 Initializes a new instance of the FMLiveSwitchTextLogProvider class. More...
 
- Class Methods inherited from FMLiveSwitchLogProvider
(NSString *) + getLogLevelStringWithLevel:
 Converts a log-level to a 5-character string for consistently-spaced character sequences. More...
 
(NSString *) + getPrefixTimestamp:
 Converts a timestamp to an ISO-8601-formatted string for rendering in a log message (YYYY-MM-DDThh:mm:ss.sssZ). More...
 
(NSString *) + getProduct
 Returns the name of the current product. More...
 
(FMLiveSwitchLogProvider *) + logProvider
 Initializes a new instance of the FMLiveSwitchLogProvider class using defaultLogLevel (FMLiveSwitchLog) as the log level. More...
 

Detailed Description

Simple log provider that writes to a local string builder.

Method Documentation

◆ callback

- (FMLiveSwitchAction1<NSString*>*) callback

Gets a callback to invoke whenever text is written to the log.

◆ clear

- (NSString*) clear

Clears all text from the log and returns the former contents.

◆ doLogWithLogEvent:

- (void) doLogWithLogEvent: (FMLiveSwitchLogEvent *)  logEvent

Logs a message at the specified log level.

Parameters
logEventThe log event details.

Implements FMLiveSwitchLogProvider.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchTextLogProvider.

Implements FMLiveSwitchLogProvider.

◆ initWithLevel:

- (instancetype) initWithLevel: (FMLiveSwitchLogLevel)  level

Initializes a new instance of the FMLiveSwitchTextLogProvider class.

Parameters
levelThe log level.

◆ setCallback:

- (void) setCallback: (FMLiveSwitchAction1< NSString * > *)  value

Sets a callback to invoke whenever text is written to the log.

◆ setCallbackBlock

- (NSString*) setCallbackBlock

Sets a callback to invoke whenever text is written to the log.

◆ setCallbackBlock:

- (void) setCallbackBlock: (void(^)(NSString *))  valueBlock

Sets a callback to invoke whenever text is written to the log.

◆ text

- (NSString*) text

Gets the logged text.

◆ textLogProvider

+ (FMLiveSwitchTextLogProvider*) textLogProvider

Initializes a new instance of the FMLiveSwitchTextLogProvider.

◆ textLogProviderWithLevel:

+ (FMLiveSwitchTextLogProvider*) textLogProviderWithLevel: (FMLiveSwitchLogLevel)  level

Initializes a new instance of the FMLiveSwitchTextLogProvider class.

Parameters
levelThe log level.