fm.liveswitch.Log Class Reference

Log utility class. More...

Public Member Functions

 Log ()
 

Static Public Member Functions

static void addProvider (fm.liveswitch.LogProvider provider)
 Registers a log provider as a logging target. More...
 
static void addProvider (fm.liveswitch.LogProvider provider, fm.liveswitch.LogLevel level)
 Registers a log provider as a logging target, setting its log level in the process. More...
 
static void debug (fm.liveswitch.LogContext context, String message)
 Logs a debug-level message. More...
 
static void debug (fm.liveswitch.LogContext context, String message, java.lang.Exception ex)
 Logs a debug-level message. More...
 
static void debug (String message)
 Logs a debug-level message. More...
 
static void debug (String message, java.lang.Exception ex)
 Logs a debug-level message. More...
 
static void error (fm.liveswitch.LogContext context, String message)
 Logs an error-level message. More...
 
static void error (fm.liveswitch.LogContext context, String message, java.lang.Exception ex)
 Logs an error-level message. More...
 
static void error (String message)
 Logs an error-level message. More...
 
static void error (String message, java.lang.Exception ex)
 Logs an error-level message. More...
 
static void fatal (fm.liveswitch.LogContext context, String message)
 Logs a fatal-level message. More...
 
static void fatal (fm.liveswitch.LogContext context, String message, java.lang.Exception ex)
 Logs a fatal-level message. More...
 
static void fatal (String message)
 Logs a fatal-level message. More...
 
static void fatal (String message, java.lang.Exception ex)
 Logs a fatal-level message. More...
 
static void flush ()
 Blocks until all logs are written out. More...
 
static fm.liveswitch.LogLevel getDefaultLogLevel ()
 Gets the default log level. More...
 
static boolean getIsDebugEnabled ()
 Gets a value indicating whether logging is enabled for debug-level messages for at least one of the registered providers. More...
 
static boolean getIsErrorEnabled ()
 Gets a value indicating whether logging is enabled for error-level messages for at least one of the registered providers. More...
 
static boolean getIsFatalEnabled ()
 Gets a value indicating whether logging is enabled for fatal-level messages for at least one of the registered providers. More...
 
static boolean getIsInfoEnabled ()
 Gets a value indicating whether logging is enabled for info-level messages for at least one of the registered providers. More...
 
static boolean getIsVerboseEnabled ()
 Gets a value indicating whether logging is enabled for verbose-level messages for at least one of the registered providers. More...
 
static boolean getIsWarnEnabled ()
 Gets a value indicating whether logging is enabled for warn-level messages for at least one of the registered providers. More...
 
static fm.liveswitch.ILog getLogger (String tag)
 Get a logger for a specific Tag. More...
 
static fm.liveswitch.ILog getLogger (String tag, fm.liveswitch.LogLevel level)
 Get a logger for a specific Tag. More...
 
static fm.liveswitch.ILog getLogger (@SuppressWarnings("rawtypes") Class type)
 Get a logger for a specific Tag. More...
 
static fm.liveswitch.ILog getLogger (@SuppressWarnings("rawtypes") Class type, fm.liveswitch.LogLevel level)
 Get a logger for a specific Tag. More...
 
static fm.liveswitch.LogLevel getLogLevel ()
 Gets the default log level. More...
 
static fm.liveswitch.LogProvider getProvider ()
 Gets the first log provider. More...
 
static fm.liveswitch.LogProvider[] getProviders ()
 Gets the log providers. More...
 
static void info (fm.liveswitch.LogContext context, String message)
 Logs an info-level message. More...
 
static void info (fm.liveswitch.LogContext context, String message, java.lang.Exception ex)
 Logs an info-level message. More...
 
static void info (String message)
 Logs an info-level message. More...
 
static void info (String message, java.lang.Exception ex)
 Logs an info-level message. More...
 
static void registerProvider (fm.liveswitch.LogProvider provider)
 Registers a log provider as a logging target. More...
 
static void registerProvider (fm.liveswitch.LogProvider provider, fm.liveswitch.LogLevel level)
 Registers a log provider as a logging target, setting its log level in the process. More...
 
static boolean removeProvider (fm.liveswitch.LogProvider provider)
 Unregisters a log provider as a logging target. More...
 
static void removeProviders ()
 Unregisters all log providers as logging targets. More...
 
static void setDefaultLogLevel (fm.liveswitch.LogLevel value)
 Sets the default log level. More...
 
static void setLogLevel (fm.liveswitch.LogLevel value)
 Sets the default log level. More...
 
static void setProvider (fm.liveswitch.LogProvider value)
 Sets the first log provider. More...
 
static void setTagOverride (String tag, fm.liveswitch.LogLevel level)
 Override the default log level for a specific tag. More...
 
static boolean unregisterProvider (fm.liveswitch.LogProvider provider)
 Unregisters a log provider as a logging target. More...
 
static void unregisterProviders ()
 Unregisters all log providers as logging targets. More...
 
static void verbose (fm.liveswitch.LogContext context, String message)
 Logs a verbose-level message. More...
 
static void verbose (fm.liveswitch.LogContext context, String message, java.lang.Exception ex)
 Logs a verbose-level message. More...
 
static void verbose (String message)
 Logs a verbose-level message. More...
 
static void verbose (String message, java.lang.Exception ex)
 Logs a verbose-level message. More...
 
static void warn (fm.liveswitch.LogContext context, String message)
 Logs a warn-level message. More...
 
static void warn (fm.liveswitch.LogContext context, String message, java.lang.Exception ex)
 Logs a warn-level message. More...
 
static void warn (String message)
 Logs a warn-level message. More...
 
static void warn (String message, java.lang.Exception ex)
 Logs a warn-level message. More...
 
static void writeLine (String text)
 Writes a line of text to the log. More...
 

Detailed Description

Log utility class.

Constructor & Destructor Documentation

◆ Log()

fm.liveswitch.Log.Log ( )

Member Function Documentation

◆ addProvider() [1/2]

static void fm.liveswitch.Log.addProvider ( fm.liveswitch.LogProvider  provider)
static

Registers a log provider as a logging target.

Alias for RegisterProvider.

Parameters
providerThe new provider.

◆ addProvider() [2/2]

static void fm.liveswitch.Log.addProvider ( fm.liveswitch.LogProvider  provider,
fm.liveswitch.LogLevel  level 
)
static

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.

◆ debug() [1/4]

static void fm.liveswitch.Log.debug ( fm.liveswitch.LogContext  context,
String  message 
)
static

Logs a debug-level message.

Parameters
messageThe message.
contextThe log context.

◆ debug() [2/4]

static void fm.liveswitch.Log.debug ( fm.liveswitch.LogContext  context,
String  message,
java.lang.Exception  ex 
)
static

Logs a debug-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ debug() [3/4]

static void fm.liveswitch.Log.debug ( String  message)
static

Logs a debug-level message.

Parameters
messageThe message.

◆ debug() [4/4]

static void fm.liveswitch.Log.debug ( String  message,
java.lang.Exception  ex 
)
static

Logs a debug-level message.

Parameters
messageThe message.
exThe exception.

◆ error() [1/4]

static void fm.liveswitch.Log.error ( fm.liveswitch.LogContext  context,
String  message 
)
static

Logs an error-level message.

Parameters
messageThe message.
contextThe log context.

◆ error() [2/4]

static void fm.liveswitch.Log.error ( fm.liveswitch.LogContext  context,
String  message,
java.lang.Exception  ex 
)
static

Logs an error-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ error() [3/4]

static void fm.liveswitch.Log.error ( String  message)
static

Logs an error-level message.

Parameters
messageThe message.

◆ error() [4/4]

static void fm.liveswitch.Log.error ( String  message,
java.lang.Exception  ex 
)
static

Logs an error-level message.

Parameters
messageThe message.
exThe exception.

◆ fatal() [1/4]

static void fm.liveswitch.Log.fatal ( fm.liveswitch.LogContext  context,
String  message 
)
static

Logs a fatal-level message.

Parameters
messageThe message.
contextThe log context.

◆ fatal() [2/4]

static void fm.liveswitch.Log.fatal ( fm.liveswitch.LogContext  context,
String  message,
java.lang.Exception  ex 
)
static

Logs a fatal-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ fatal() [3/4]

static void fm.liveswitch.Log.fatal ( String  message)
static

Logs a fatal-level message.

Parameters
messageThe message.

◆ fatal() [4/4]

static void fm.liveswitch.Log.fatal ( String  message,
java.lang.Exception  ex 
)
static

Logs a fatal-level message.

Parameters
messageThe message.
exThe exception.

◆ flush()

static void fm.liveswitch.Log.flush ( )
static

Blocks until all logs are written out.

◆ getDefaultLogLevel()

static fm.liveswitch.LogLevel fm.liveswitch.Log.getDefaultLogLevel ( )
static

Gets the default log level.

◆ getIsDebugEnabled()

static boolean fm.liveswitch.Log.getIsDebugEnabled ( )
static

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

◆ getIsErrorEnabled()

static boolean fm.liveswitch.Log.getIsErrorEnabled ( )
static

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

◆ getIsFatalEnabled()

static boolean fm.liveswitch.Log.getIsFatalEnabled ( )
static

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

◆ getIsInfoEnabled()

static boolean fm.liveswitch.Log.getIsInfoEnabled ( )
static

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

◆ getIsVerboseEnabled()

static boolean fm.liveswitch.Log.getIsVerboseEnabled ( )
static

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

◆ getIsWarnEnabled()

static boolean fm.liveswitch.Log.getIsWarnEnabled ( )
static

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

◆ getLogger() [1/4]

static fm.liveswitch.ILog fm.liveswitch.Log.getLogger ( @SuppressWarnings("rawtypes") Class  type)
static

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.

◆ getLogger() [2/4]

static fm.liveswitch.ILog fm.liveswitch.Log.getLogger ( @SuppressWarnings("rawtypes") Class  type,
fm.liveswitch.LogLevel  level 
)
static

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.

◆ getLogger() [3/4]

static fm.liveswitch.ILog fm.liveswitch.Log.getLogger ( String  tag)
static

Get a logger for a specific Tag.

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

◆ getLogger() [4/4]

static fm.liveswitch.ILog fm.liveswitch.Log.getLogger ( String  tag,
fm.liveswitch.LogLevel  level 
)
static

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.

◆ getLogLevel()

static fm.liveswitch.LogLevel fm.liveswitch.Log.getLogLevel ( )
static

Gets the default log level.

Deprecated:
Use DefaultLogLevel instead.

◆ getProvider()

static fm.liveswitch.LogProvider fm.liveswitch.Log.getProvider ( )
static

Gets the first log provider.

◆ getProviders()

static fm.liveswitch.LogProvider [] fm.liveswitch.Log.getProviders ( )
static

Gets the log providers.

◆ info() [1/4]

static void fm.liveswitch.Log.info ( fm.liveswitch.LogContext  context,
String  message 
)
static

Logs an info-level message.

Parameters
messageThe message.
contextThe log context.

◆ info() [2/4]

static void fm.liveswitch.Log.info ( fm.liveswitch.LogContext  context,
String  message,
java.lang.Exception  ex 
)
static

Logs an info-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ info() [3/4]

static void fm.liveswitch.Log.info ( String  message)
static

Logs an info-level message.

Parameters
messageThe message.

◆ info() [4/4]

static void fm.liveswitch.Log.info ( String  message,
java.lang.Exception  ex 
)
static

Logs an info-level message.

Parameters
messageThe message.
exThe exception.

◆ registerProvider() [1/2]

static void fm.liveswitch.Log.registerProvider ( fm.liveswitch.LogProvider  provider)
static

Registers a log provider as a logging target.

Parameters
providerThe provider.

◆ registerProvider() [2/2]

static void fm.liveswitch.Log.registerProvider ( fm.liveswitch.LogProvider  provider,
fm.liveswitch.LogLevel  level 
)
static

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

Parameters
providerThe provider.
levelThe log level.

◆ removeProvider()

static boolean fm.liveswitch.Log.removeProvider ( fm.liveswitch.LogProvider  provider)
static

Unregisters a log provider as a logging target.

Alias for UnregisterProvider.

Parameters
providerThe provider.

◆ removeProviders()

static void fm.liveswitch.Log.removeProviders ( )
static

Unregisters all log providers as logging targets.

Alias for UnregisterProviders.

◆ setDefaultLogLevel()

static void fm.liveswitch.Log.setDefaultLogLevel ( fm.liveswitch.LogLevel  value)
static

Sets the default log level.

◆ setLogLevel()

static void fm.liveswitch.Log.setLogLevel ( fm.liveswitch.LogLevel  value)
static

Sets the default log level.

Deprecated:
Use DefaultLogLevel instead.

◆ setProvider()

static void fm.liveswitch.Log.setProvider ( fm.liveswitch.LogProvider  value)
static

Sets the first log provider.

◆ setTagOverride()

static void fm.liveswitch.Log.setTagOverride ( String  tag,
fm.liveswitch.LogLevel  level 
)
static

Override the default log level for a specific tag.

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

◆ unregisterProvider()

static boolean fm.liveswitch.Log.unregisterProvider ( fm.liveswitch.LogProvider  provider)
static

Unregisters a log provider as a logging target.

Parameters
providerThe provider.

◆ unregisterProviders()

static void fm.liveswitch.Log.unregisterProviders ( )
static

Unregisters all log providers as logging targets.

◆ verbose() [1/4]

static void fm.liveswitch.Log.verbose ( fm.liveswitch.LogContext  context,
String  message 
)
static

Logs a verbose-level message.

Parameters
messageThe message.
contextThe log context.

◆ verbose() [2/4]

static void fm.liveswitch.Log.verbose ( fm.liveswitch.LogContext  context,
String  message,
java.lang.Exception  ex 
)
static

Logs a verbose-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ verbose() [3/4]

static void fm.liveswitch.Log.verbose ( String  message)
static

Logs a verbose-level message.

Parameters
messageThe message.

◆ verbose() [4/4]

static void fm.liveswitch.Log.verbose ( String  message,
java.lang.Exception  ex 
)
static

Logs a verbose-level message.

Parameters
messageThe message.
exThe exception.

◆ warn() [1/4]

static void fm.liveswitch.Log.warn ( fm.liveswitch.LogContext  context,
String  message 
)
static

Logs a warn-level message.

Parameters
messageThe message.
contextThe log context.

◆ warn() [2/4]

static void fm.liveswitch.Log.warn ( fm.liveswitch.LogContext  context,
String  message,
java.lang.Exception  ex 
)
static

Logs a warn-level message.

Parameters
messageThe message.
exThe exception.
contextThe log context.

◆ warn() [3/4]

static void fm.liveswitch.Log.warn ( String  message)
static

Logs a warn-level message.

Parameters
messageThe message.

◆ warn() [4/4]

static void fm.liveswitch.Log.warn ( String  message,
java.lang.Exception  ex 
)
static

Logs a warn-level message.

Parameters
messageThe message.
exThe exception.

◆ writeLine()

static void fm.liveswitch.Log.writeLine ( String  text)
static

Writes a line of text to the log.

Parameters
textThe text to write to the log.