Packages

class Console extends Object

The console module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers.

The module exports two specific components:

  • A Console class with methods such as console.log(), console.error() and console.warn() that can be used to write to any Node.js stream.
  • A global console instance configured to write to stdout and stderr. Because this object is global, it can be used without calling require('console').
Annotations
@RawJSType() @native() @JSImport( "console" , "Console" )
Version

7.4.0

See also

https://nodejs.org/api/console.html

Linear Supertypes
Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Console
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Console(stdout: Writable, stderr: Writable = js.native)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def assert(value: Any, args: Any*): Unit

    A simple assertion test that verifies whether value is truthy.

    A simple assertion test that verifies whether value is truthy. If it is not, an AssertionError is thrown. If provided, the error message is formatted using util.format() and used as the error message.

    Example:
    1. console.assert(value[, message][, ...])

  6. def assert(value: Any, message: String, args: Any*): Unit

    A simple assertion test that verifies whether value is truthy.

    A simple assertion test that verifies whether value is truthy. If it is not, an AssertionError is thrown. If provided, the error message is formatted using util.format() and used as the error message.

    Example:
    1. console.assert(value[, message][, ...])

  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def dir(obj: Any): Unit

    Uses util.inspect() on obj and prints the resulting string to stdout.

    Uses util.inspect() on obj and prints the resulting string to stdout. This function bypasses any custom inspect() function defined on obj

    Example:
    1. console.dir(obj[, options])

  9. def dir(obj: Any, options: ConsoleDirOptions): Unit

    Uses util.inspect() on obj and prints the resulting string to stdout.

    Uses util.inspect() on obj and prints the resulting string to stdout. This function bypasses any custom inspect() function defined on obj

    Example:
    1. console.dir(obj[, options])

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def error(data: Any, args: Any*): Unit

    Prints to stderr with newline.

    Prints to stderr with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

    data

    the given data arguments

    Example:
    1. console.error([data][, ...])

  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  15. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. def info(data: Any, args: Any*): Unit

    The console.info() function is an alias for console.log().

    The console.info() function is an alias for console.log().

    Example:
    1. console.info([data][, ...])

  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  20. def log(data: Any, args: Any*): Unit

    Prints to stdout with newline.

    Prints to stdout with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

    data

    the given data arguments

    Example:
    1. console.log([data][, ...])

  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  24. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def time(label: String): Unit

    Starts a timer that can be used to compute the duration of an operation.

    Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique label. Use the same label when you call console.timeEnd() to stop the timer and output the elapsed time in milliseconds to stdout. Timer durations are accurate to the sub-millisecond.

    Example:
    1. console.time(label)

  27. def timeEnd(label: String): Unit

    Stops a timer that was previously started by calling console.time() and prints the result to stdout

    Stops a timer that was previously started by calling console.time() and prints the result to stdout

    Example:
    1. console.timeEnd(label)

  28. def toLocaleString(): String
    Definition Classes
    Object
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def trace(message: String, args: Any*): Unit

    Prints to stderr the string 'Trace :', followed by the util.format() formatted message and stack trace to the current position in the code.

    Prints to stderr the string 'Trace :', followed by the util.format() formatted message and stack trace to the current position in the code.

    Example:
    1. console.trace(message[, ...])

  31. def valueOf(): Any
    Definition Classes
    Object
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def warn(data: Any, args: Any*): Unit

    Prints to stdout with newline.

    Prints to stdout with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

    data

    the given data arguments

    Example:
    1. console.log([data][, ...])

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped