Module: ko/logging

Example

var log = require("ko/logging").getLogger("foo");
log.setLevel(log.DEBUG);
log.debug("hello world!");
Author:
  • ActiveState
License:
  • Mozilla Public License v. 2.0

Classes

Logger()

Methods


require("ko/logging").globalDeprecatedByAlternative(deprecatedName, replacementName, logger, global)

Mark global var/function as being deprecated with an alternative. All calls to the item will be logged with a one-off warning.

Parameters:
Name Type Description
deprecatedName string

The global variable name that is deprecated

replacementName string

The new replacement code (an expression to eval)

logger Logger

The logger to use (from ko.logging.getLogger), or null to use the default

global Object

The global to attach to.


require("ko/logging").propertyDeprecatedByAlternative(object, deprecatedName, replacementName, logger)

Mark object property as being deprecated with an alternative. All gets to the item will be logged with a one-off warning.

Parameters:
Name Type Description
object Object

The object on which the deprecated property exists

deprecatedName string

The global variable name that is deprecated

replacementName string

An expression to get the replacement; |this| is the object

logger Logger

The logger to use (from ko.logging.getLogger), or null to use the default


require("ko/logging").getLogger(logger_name)

Retrieve the given logger

Parameters:
Name Type Description
logger_name String

Name of the logger (creates it if it does not exist)

Returns:
Type
Logger