Class: Toybox::Test::Logger

Inherits:
Lang::Object show all

Overview

The Logger class provides output capabilities to tests.

It is not necessary to instantiate the Logger class. This is done automatically behind the scenes.

Since:

  • 2.1.0

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Method Details

debug(str) ⇒ Object

Write a debug String to the output stream.

The String is prefixed with DEBUG and a time stamp.

Examples:

using Toybox.Test;
(:test)
function aDebugTest(logger) {
   logger.debug("This is a debug message.");
   return true;
}
// Output:
DEBUG (9:23): This is a debug message.

Parameters:

Since:

  • 2.1.0


10174
10175
# File 'Monkeybrains.rb', line 10174

def debug(str)
end

error(str) ⇒ Object

Write an error String to the output stream.

The String is prefixed with ERROR and time stamp.

Examples:

using Toybox.Test;
(:test)
function anErrorTest(logger) {
   logger.error("This is an error message.");
   return true;
}
// Output:
ERROR (9:24): This is an error message.

Parameters:

Since:

  • 2.1.0


10208
10209
# File 'Monkeybrains.rb', line 10208

def error(str)
end

warning(str) ⇒ Object

Write a warning String to the output stream.

The String is prefixed with WARNING and a time stamp.

Examples:

using Toybox.Test;
(:test)
function aWarningTest(logger) {
   logger.warning("This is a warning message.");
   return true;
}
// Output:
WARNING (9:23): This is a warning message.

Parameters:

Since:

  • 2.1.0


10191
10192
# File 'Monkeybrains.rb', line 10191

def warning(str)
end