FMLiveSwitchLog Class Reference

Log utility class. More...

Instance Methods

(instancetype) - init
 

Class Methods

(void) + addProvider:
 Registers a log provider as a logging target. More...
 
(void) + addProvider:level:
 Registers a log provider as a logging target, setting its log level in the process. More...
 
(void) + debugWithContext:message:
 Logs a debug-level message. More...
 
(void) + debugWithContext:message:ex:
 Logs a debug-level message. More...
 
(void) + debugWithMessage:
 Logs a debug-level message. More...
 
(void) + debugWithMessage:ex:
 Logs a debug-level message. More...
 
(FMLiveSwitchLogLevel) + defaultLogLevel
 Gets the default log level. More...
 
(void) + errorWithContext:message:
 Logs an error-level message. More...
 
(void) + errorWithContext:message:ex:
 Logs an error-level message. More...
 
(void) + errorWithMessage:
 Logs an error-level message. More...
 
(void) + errorWithMessage:ex:
 Logs an error-level message. More...
 
(void) + fatalWithContext:message:
 Logs a fatal-level message. More...
 
(void) + fatalWithContext:message:ex:
 Logs a fatal-level message. More...
 
(void) + fatalWithMessage:
 Logs a fatal-level message. More...
 
(void) + fatalWithMessage:ex:
 Logs a fatal-level message. More...
 
(void) + flush
 Blocks until all logs are written out. More...
 
(NSObject< FMLiveSwitchILog > *) + getLoggerWithTag:
 Get a logger for a specific Tag. More...
 
(NSObject< FMLiveSwitchILog > *) + getLoggerWithTag:level:
 Get a logger for a specific Tag. More...
 
(NSObject< FMLiveSwitchILog > *) + getLoggerWithType:
 Get a logger for a specific Tag. More...
 
(NSObject< FMLiveSwitchILog > *) + getLoggerWithType:level:
 Get a logger for a specific Tag. More...
 
(void) + infoWithContext:message:
 Logs an info-level message. More...
 
(void) + infoWithContext:message:ex:
 Logs an info-level message. More...
 
(void) + infoWithMessage:
 Logs an info-level message. More...
 
(void) + infoWithMessage:ex:
 Logs an info-level message. More...
 
(bool) + isDebugEnabled
 Gets a value indicating whether logging is enabled for debug-level messages for at least one of the registered providers. More...
 
(bool) + isErrorEnabled
 Gets a value indicating whether logging is enabled for error-level messages for at least one of the registered providers. More...
 
(bool) + isFatalEnabled
 Gets a value indicating whether logging is enabled for fatal-level messages for at least one of the registered providers. More...
 
(bool) + isInfoEnabled
 Gets a value indicating whether logging is enabled for info-level messages for at least one of the registered providers. More...
 
(bool) + isVerboseEnabled
 Gets a value indicating whether logging is enabled for verbose-level messages for at least one of the registered providers. More...
 
(bool) + isWarnEnabled
 Gets a value indicating whether logging is enabled for warn-level messages for at least one of the registered providers. More...
 
(FMLiveSwitchLog *) + log
 
(FMLiveSwitchLogLevel) + logLevel
 Gets the default log level. More...
 
(FMLiveSwitchLogProvider *) + provider
 Gets the first log provider. More...
 
(NSMutableArray *) + providers
 Gets the log providers. More...
 
(void) + registerProvider:
 Registers a log provider as a logging target. More...
 
(void) + registerProvider:level:
 Registers a log provider as a logging target, setting its log level in the process. More...
 
(bool) + removeProvider:
 Unregisters a log provider as a logging target. More...
 
(void) + removeProviders
 Unregisters all log providers as logging targets. More...
 
(void) + setDefaultLogLevel:
 Sets the default log level. More...
 
(void) + setLogLevel:
 Sets the default log level. More...
 
(void) + setProvider:
 Sets the first log provider. More...
 
(void) + setTagOverrideWithTag:level:
 Override the default log level for a specific tag. More...
 
(bool) + unregisterProvider:
 Unregisters a log provider as a logging target. More...
 
(void) + unregisterProviders
 Unregisters all log providers as logging targets. More...
 
(void) + verboseWithContext:message:
 Logs a verbose-level message. More...
 
(void) + verboseWithContext:message:ex:
 Logs a verbose-level message. More...
 
(void) + verboseWithMessage:
 Logs a verbose-level message. More...
 
(void) + verboseWithMessage:ex:
 Logs a verbose-level message. More...
 
(void) + warnWithContext:message:
 Logs a warn-level message. More...
 
(void) + warnWithContext:message:ex:
 Logs a warn-level message. More...
 
(void) + warnWithMessage:
 Logs a warn-level message. More...
 
(void) + warnWithMessage:ex:
 Logs a warn-level message. More...
 
(void) + writeLineWithText:
 Writes a line of text to the log. More...
 

Detailed Description

Log utility class.

Method Documentation

◆ addProvider:

+ (void) addProvider: (FMLiveSwitchLogProvider *)  provider

Registers a log provider as a logging target.

Alias for RegisterProvider.

Parameters
providerThe new provider.

◆ addProvider:level:

+ (void) addProvider: (FMLiveSwitchLogProvider *)  provider
level: (FMLiveSwitchLogLevel)  level 

Registers a log provider as a logging target, setting its log level in the process.

Alias for RegisterProvider.

Parameters
providerThe new provider.
levelThe log level.

◆ debugWithContext:message:

+ (void) debugWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message 

Logs a debug-level message.

Parameters
messageThe message.
contextThe log context.

◆ debugWithContext:message:ex:

+ (void) debugWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message
ex: (NSException *)  ex 

Logs a debug-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ debugWithMessage:

+ (void) debugWithMessage: (NSString *)  message

Logs a debug-level message.

Parameters
messageThe message.

◆ debugWithMessage:ex:

+ (void) debugWithMessage: (NSString *)  message
ex: (NSException *)  ex 

Logs a debug-level message.

Parameters
messageThe message.
exThe exception.

◆ defaultLogLevel

+ (FMLiveSwitchLogLevel) defaultLogLevel

Gets the default log level.

◆ errorWithContext:message:

+ (void) errorWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message 

Logs an error-level message.

Parameters
messageThe message.
contextThe log context.

◆ errorWithContext:message:ex:

+ (void) errorWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message
ex: (NSException *)  ex 

Logs an error-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ errorWithMessage:

+ (void) errorWithMessage: (NSString *)  message

Logs an error-level message.

Parameters
messageThe message.

◆ errorWithMessage:ex:

+ (void) errorWithMessage: (NSString *)  message
ex: (NSException *)  ex 

Logs an error-level message.

Parameters
messageThe message.
exThe exception.

◆ fatalWithContext:message:

+ (void) fatalWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message 

Logs a fatal-level message.

Parameters
messageThe message.
contextThe log context.

◆ fatalWithContext:message:ex:

+ (void) fatalWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message
ex: (NSException *)  ex 

Logs a fatal-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ fatalWithMessage:

+ (void) fatalWithMessage: (NSString *)  message

Logs a fatal-level message.

Parameters
messageThe message.

◆ fatalWithMessage:ex:

+ (void) fatalWithMessage: (NSString *)  message
ex: (NSException *)  ex 

Logs a fatal-level message.

Parameters
messageThe message.
exThe exception.

◆ flush

+ (void) flush

Blocks until all logs are written out.

◆ getLoggerWithTag:

+ (NSObject<FMLiveSwitchILog>*) getLoggerWithTag: (NSString *)  tag

Get a logger for a specific Tag.

Parameters
tagThe tag to log to.
Returns
A ILog that will log to the specified tag.

◆ getLoggerWithTag:level:

+ (NSObject<FMLiveSwitchILog>*) getLoggerWithTag: (NSString *)  tag
level: (FMLiveSwitchLogLevel)  level 

Get a logger for a specific Tag.

Parameters
tagThe tag to log to.
levelLogger's default log level.
Returns
A ILog that will log to the specified tag.

◆ getLoggerWithType:

+ (NSObject<FMLiveSwitchILog>*) getLoggerWithType: (Class)  type

Get a logger for a specific Tag.

The tag is taken from the class namespace and name.

Parameters
typeThe type to use as the tag.
Returns
A ILog that will log to the specified tag.

◆ getLoggerWithType:level:

+ (NSObject<FMLiveSwitchILog>*) getLoggerWithType: (Class)  type
level: (FMLiveSwitchLogLevel)  level 

Get a logger for a specific Tag.

The tag is taken from the class namespace and name.

Parameters
typeThe type to use as the tag.
levelLogger's default log level.
Returns
A ILog that will log to the specified tag.

◆ infoWithContext:message:

+ (void) infoWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message 

Logs an info-level message.

Parameters
messageThe message.
contextThe log context.

◆ infoWithContext:message:ex:

+ (void) infoWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message
ex: (NSException *)  ex 

Logs an info-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ infoWithMessage:

+ (void) infoWithMessage: (NSString *)  message

Logs an info-level message.

Parameters
messageThe message.

◆ infoWithMessage:ex:

+ (void) infoWithMessage: (NSString *)  message
ex: (NSException *)  ex 

Logs an info-level message.

Parameters
messageThe message.
exThe exception.

◆ init

- (instancetype) init

◆ isDebugEnabled

+ (bool) isDebugEnabled

Gets a value indicating whether logging is enabled for debug-level messages for at least one of the registered providers.

◆ isErrorEnabled

+ (bool) isErrorEnabled

Gets a value indicating whether logging is enabled for error-level messages for at least one of the registered providers.

◆ isFatalEnabled

+ (bool) isFatalEnabled

Gets a value indicating whether logging is enabled for fatal-level messages for at least one of the registered providers.

◆ isInfoEnabled

+ (bool) isInfoEnabled

Gets a value indicating whether logging is enabled for info-level messages for at least one of the registered providers.

◆ isVerboseEnabled

+ (bool) isVerboseEnabled

Gets a value indicating whether logging is enabled for verbose-level messages for at least one of the registered providers.

◆ isWarnEnabled

+ (bool) isWarnEnabled

Gets a value indicating whether logging is enabled for warn-level messages for at least one of the registered providers.

◆ log

+ (FMLiveSwitchLog*) log

◆ logLevel

+ (FMLiveSwitchLogLevel) logLevel

Gets the default log level.

Deprecated:
Use DefaultLogLevel instead.

◆ provider

+ (FMLiveSwitchLogProvider*) provider

Gets the first log provider.

◆ providers

+ (NSMutableArray*) providers

Gets the log providers.

◆ registerProvider:

+ (void) registerProvider: (FMLiveSwitchLogProvider *)  provider

Registers a log provider as a logging target.

Parameters
providerThe provider.

◆ registerProvider:level:

+ (void) registerProvider: (FMLiveSwitchLogProvider *)  provider
level: (FMLiveSwitchLogLevel)  level 

Registers a log provider as a logging target, setting its log level in the process.

Parameters
providerThe provider.
levelThe log level.

◆ removeProvider:

+ (bool) removeProvider: (FMLiveSwitchLogProvider *)  provider

Unregisters a log provider as a logging target.

Alias for UnregisterProvider.

Parameters
providerThe provider.

◆ removeProviders

+ (void) removeProviders

Unregisters all log providers as logging targets.

Alias for UnregisterProviders.

◆ setDefaultLogLevel:

+ (void) setDefaultLogLevel: (FMLiveSwitchLogLevel)  value

Sets the default log level.

◆ setLogLevel:

+ (void) setLogLevel: (FMLiveSwitchLogLevel)  value

Sets the default log level.

Deprecated:
Use DefaultLogLevel instead.

◆ setProvider:

+ (void) setProvider: (FMLiveSwitchLogProvider *)  value

Sets the first log provider.

◆ setTagOverrideWithTag:level:

+ (void) setTagOverrideWithTag: (NSString *)  tag
level: (FMLiveSwitchLogLevel)  level 

Override the default log level for a specific tag.

Parameters
tagThe Tag to set the log level to.
levelThe new loglevel to use.

◆ unregisterProvider:

+ (bool) unregisterProvider: (FMLiveSwitchLogProvider *)  provider

Unregisters a log provider as a logging target.

Parameters
providerThe provider.

◆ unregisterProviders

+ (void) unregisterProviders

Unregisters all log providers as logging targets.

◆ verboseWithContext:message:

+ (void) verboseWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message 

Logs a verbose-level message.

Parameters
messageThe message.
contextThe log context.

◆ verboseWithContext:message:ex:

+ (void) verboseWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message
ex: (NSException *)  ex 

Logs a verbose-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ verboseWithMessage:

+ (void) verboseWithMessage: (NSString *)  message

Logs a verbose-level message.

Parameters
messageThe message.

◆ verboseWithMessage:ex:

+ (void) verboseWithMessage: (NSString *)  message
ex: (NSException *)  ex 

Logs a verbose-level message.

Parameters
messageThe message.
exThe exception.

◆ warnWithContext:message:

+ (void) warnWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message 

Logs a warn-level message.

Parameters
messageThe message.
contextThe log context.

◆ warnWithContext:message:ex:

+ (void) warnWithContext: (FMLiveSwitchLogContext *)  context
message: (NSString *)  message
ex: (NSException *)  ex 

Logs a warn-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ warnWithMessage:

+ (void) warnWithMessage: (NSString *)  message

Logs a warn-level message.

Parameters
messageThe message.

◆ warnWithMessage:ex:

+ (void) warnWithMessage: (NSString *)  message
ex: (NSException *)  ex 

Logs a warn-level message.

Parameters
messageThe message.
exThe exception.

◆ writeLineWithText:

+ (void) writeLineWithText: (NSString *)  text

Writes a line of text to the log.

Parameters
textThe text to write to the log.