Class Log


  • public class Log
    extends Object
    The static methods of this class are made available as functions in the scripts. This allows a script to log to the SLF4J-Log.
    Author:
    Thomas Eichstaedt-Engelen - Initial contribution
    • Constructor Summary

      Constructors 
      Constructor Description
      Log()  
    • Constructor Detail

      • Log

        public Log()
    • Method Detail

      • logDebug

        public static void logDebug​(String loggerName,
                                    String format,
                                    Object... args)
        Creates the Log-Entry format with level DEBUG and logs under the loggers name org.openhab.core.model.script.<loggerName>
        Parameters:
        loggerName - the name of the Logger which is prefixed with org.openhab.core.model.script.
        format - the Log-Statement which can contain placeholders '{}'
        args - the arguments to replace the placeholders contained in format
        See Also:
        Logger
      • logInfo

        public static void logInfo​(String loggerName,
                                   String format,
                                   Object... args)
        Creates the Log-Entry format with level INFO and logs under the loggers name org.openhab.core.model.script.<loggerName>
        Parameters:
        loggerName - the name of the Logger which is prefixed with org.openhab.core.model.script.
        format - the Log-Statement which can contain placeholders '{}'
        args - the arguments to replace the placeholders contained in format
        See Also:
        Logger
      • logWarn

        public static void logWarn​(String loggerName,
                                   String format,
                                   Object... args)
        Creates the Log-Entry format with level WARN and logs under the loggers name org.openhab.core.model.script.<loggerName>
        Parameters:
        loggerName - the name of the Logger which is prefixed with org.openhab.core.model.script.
        format - the Log-Statement which can contain placeholders '{}'
        args - the arguments to replace the placeholders contained in format
        See Also:
        Logger
      • logError

        public static void logError​(String loggerName,
                                    String format,
                                    Object... args)
        Creates the Log-Entry format with level ERROR and logs under the loggers name org.openhab.core.model.script.<loggerName>
        Parameters:
        loggerName - the name of the Logger which is prefixed with org.openhab.core.model.script.
        format - the Log-Statement which can contain placeholders '{}'
        args - the arguments to replace the placeholders contained in format
        See Also:
        Logger