Show a message in the console, only if the debug mode is enabled.

This method shows a styled message in the console if the debug mode of artyom is enabled.

Argument order Argument name Type Description
1 message String String
2 type String
  • normal (default if the second argument is ignored)
  • error
  • info
  • warn

Artyom uses this function internally in order to give some message or progress of the library but only if the debug property of artyom is set to true. To show a message in the console using the artyom.debug method be sure that the debug property of artyom is set to true either in the initialization or by changing the internal debug property dinamically with the setDebug method:

var artyom = new Artyom();

// The debug mode needs to be enabled, otherwise nothing will happen
artyom.initialize({debug:true});
// Or set the debug mode dinamically
artyom.setDebug(true);

Then show any of the type of messages in the console:

var artyom = new Artyom();

// Normal message
artyom.debug("This is a normal debug message");
// Information message
artyom.debug("This is an info debug message","info");
// Warning message
artyom.debug("This is a warning debug message","warn");
// Error message
artyom.debug("This is an error debug message","error");