Example
var log = require("ko/logging").getLogger("foo");
log.setLevel(log.DEBUG);
log.debug("hello world!");
- Copyright:
-
- (c) 2017 ActiveState Software Inc.
- License:
-
- Mozilla Public License v. 2.0
Classes
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 deprecatedNamestring The global variable name that is deprecated
replacementNamestring The new replacement code (an expression to eval)
loggerLogger The logger to use (from ko.logging.getLogger), or null to use the default
globalObject 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 objectObject The object on which the deprecated property exists
deprecatedNamestring The global variable name that is deprecated
replacementNamestring An expression to get the replacement; |this| is the object
loggerLogger 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_nameString Name of the logger (creates it if it does not exist)
Returns:
- Type
- Logger