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


11508
11509
# File 'Monkeybrains.rb', line 11508

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


11542
11543
# File 'Monkeybrains.rb', line 11542

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


11525
11526
# File 'Monkeybrains.rb', line 11525

def warning(str)
end