From bc212899a32f4b945394d65bf903fb9de2c193f4 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Fri, 27 Feb 2015 23:06:05 -0500 Subject: [PATCH] chore(all): prepare release 0.2.4 --- bower.json | 2 +- dist/amd/index.js | 95 ++++++++++++++++++++++++++++++++++++++++- dist/commonjs/index.js | 95 ++++++++++++++++++++++++++++++++++++++++- dist/system/index.js | 96 ++++++++++++++++++++++++++++++++++++++++-- doc/CHANGELOG.md | 5 ++- package.json | 2 +- 6 files changed, 285 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index e9b2bb8..1587fbd 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-logging", - "version": "0.2.3", + "version": "0.2.4", "description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", "keywords": [ "aurelia", diff --git a/dist/amd/index.js b/dist/amd/index.js index 85ccceb..1088e6b 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -3,9 +3,49 @@ define(["exports"], function (exports) { var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + + /** + * Gets an instance of a logger by the Id used when creating. + * + * @method getLogger + * @param {string} id The id of the logger you wish to get an instance of. + * @return {Logger} The instance of the logger, or creates a new logger if none exists for that Id. + * @for export + */ exports.getLogger = getLogger; + + /** + * Adds an appender capable of processing logs and channeling them to an output. + * + * @method addAppender + * @param {Object} appender An appender instance to begin processing logs with. + * @for export + */ exports.addAppender = addAppender; + + /** + * Sets the level of the logging for the application loggers + * + * @method setLevel + * @param {Number} level Matches an enum specifying the level of logging. + * @for export + */ exports.setLevel = setLevel; + /** + * This library is part of the Aurelia platform and contains a minimal but effective logging mechanism + * with support for log levels and pluggable log appenders. + * + * @module logging + */ + + /** + * Enum specifying the levels of the logger + * + * @property levels + * @type Enum + * @for export + */ var levels = exports.levels = { none: 0, error: 1, @@ -81,7 +121,6 @@ define(["exports"], function (exports) { return logger; } - function getLogger(id) { return loggers[id] || (loggers[id] = createLogger(id)); } @@ -100,8 +139,25 @@ define(["exports"], function (exports) { logLevel = level; } + /** + * The logger is essentially responsible for having log statements that appear during debugging but are squelched + * when using the build tools, depending on the log level that is set. The available levels are - + * 1. none + * 2. error + * 3. warn + * 4. info + * 5. debug + * + * You cannot instantiate the logger directly - you must use the getLogger method instead. + * + * @class Logger + * @constructor + */ + var Logger = exports.Logger = (function () { function Logger(id, key) { + _classCallCheck(this, Logger); + if (key !== loggerConstructionKey) { throw new Error("You cannot instantiate \"Logger\". Use the \"getLogger\" API instead."); } @@ -111,21 +167,53 @@ define(["exports"], function (exports) { _prototypeProperties(Logger, null, { debug: { + + /** + * Logs a debug message. + * + * @method debug + * @param {string} message The message to log + */ + value: function debug() {}, writable: true, configurable: true }, info: { + + /** + * Logs info. + * + * @method info + * @param {string} message The message to log + */ + value: function info() {}, writable: true, configurable: true }, warn: { + + /** + * Logs a warning. + * + * @method warn + * @param {string} message The message to log + */ + value: function warn() {}, writable: true, configurable: true }, error: { + + /** + * Logs an error. + * + * @method error + * @param {string} message The message to log + */ + value: function error() {}, writable: true, configurable: true @@ -134,5 +222,8 @@ define(["exports"], function (exports) { return Logger; })(); - exports.__esModule = true; + + Object.defineProperty(exports, "__esModule", { + value: true + }); }); \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index d548011..c83f376 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -2,9 +2,49 @@ var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + +/** +* Gets an instance of a logger by the Id used when creating. +* +* @method getLogger +* @param {string} id The id of the logger you wish to get an instance of. +* @return {Logger} The instance of the logger, or creates a new logger if none exists for that Id. +* @for export +*/ exports.getLogger = getLogger; + +/** + * Adds an appender capable of processing logs and channeling them to an output. + * + * @method addAppender + * @param {Object} appender An appender instance to begin processing logs with. + * @for export + */ exports.addAppender = addAppender; + +/** +* Sets the level of the logging for the application loggers +* +* @method setLevel +* @param {Number} level Matches an enum specifying the level of logging. +* @for export +*/ exports.setLevel = setLevel; +/** + * This library is part of the Aurelia platform and contains a minimal but effective logging mechanism + * with support for log levels and pluggable log appenders. + * + * @module logging + */ + +/** +* Enum specifying the levels of the logger +* +* @property levels +* @type Enum +* @for export +*/ var levels = exports.levels = { none: 0, error: 1, @@ -80,7 +120,6 @@ function createLogger(id) { return logger; } - function getLogger(id) { return loggers[id] || (loggers[id] = createLogger(id)); } @@ -99,8 +138,25 @@ function setLevel(level) { logLevel = level; } +/** +* The logger is essentially responsible for having log statements that appear during debugging but are squelched +* when using the build tools, depending on the log level that is set. The available levels are - +* 1. none +* 2. error +* 3. warn +* 4. info +* 5. debug +* +* You cannot instantiate the logger directly - you must use the getLogger method instead. +* +* @class Logger +* @constructor +*/ + var Logger = exports.Logger = (function () { function Logger(id, key) { + _classCallCheck(this, Logger); + if (key !== loggerConstructionKey) { throw new Error("You cannot instantiate \"Logger\". Use the \"getLogger\" API instead."); } @@ -110,21 +166,53 @@ var Logger = exports.Logger = (function () { _prototypeProperties(Logger, null, { debug: { + + /** + * Logs a debug message. + * + * @method debug + * @param {string} message The message to log + */ + value: function debug() {}, writable: true, configurable: true }, info: { + + /** + * Logs info. + * + * @method info + * @param {string} message The message to log + */ + value: function info() {}, writable: true, configurable: true }, warn: { + + /** + * Logs a warning. + * + * @method warn + * @param {string} message The message to log + */ + value: function warn() {}, writable: true, configurable: true }, error: { + + /** + * Logs an error. + * + * @method error + * @param {string} message The message to log + */ + value: function error() {}, writable: true, configurable: true @@ -133,4 +221,7 @@ var Logger = exports.Logger = (function () { return Logger; })(); -exports.__esModule = true; \ No newline at end of file + +Object.defineProperty(exports, "__esModule", { + value: true +}); \ No newline at end of file diff --git a/dist/system/index.js b/dist/system/index.js index af3acb2..392bb76 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -1,11 +1,35 @@ System.register([], function (_export) { - "use strict"; + var _prototypeProperties, _classCallCheck, levels, loggers, logLevel, appenders, slice, loggerConstructionKey, Logger; + + /** + * Gets an instance of a logger by the Id used when creating. + * + * @method getLogger + * @param {string} id The id of the logger you wish to get an instance of. + * @return {Logger} The instance of the logger, or creates a new logger if none exists for that Id. + * @for export + */ - var _prototypeProperties, levels, loggers, logLevel, appenders, slice, loggerConstructionKey, Logger; _export("getLogger", getLogger); + /** + * Adds an appender capable of processing logs and channeling them to an output. + * + * @method addAppender + * @param {Object} appender An appender instance to begin processing logs with. + * @for export + */ + _export("addAppender", addAppender); + /** + * Sets the level of the logging for the application loggers + * + * @method setLevel + * @param {Number} level Matches an enum specifying the level of logging. + * @for export + */ + _export("setLevel", setLevel); function log(logger, level, args) { @@ -69,7 +93,6 @@ System.register([], function (_export) { return logger; } - function getLogger(id) { return loggers[id] || (loggers[id] = createLogger(id)); } @@ -91,8 +114,26 @@ System.register([], function (_export) { return { setters: [], execute: function () { + "use strict"; + _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + + /** + * This library is part of the Aurelia platform and contains a minimal but effective logging mechanism + * with support for log levels and pluggable log appenders. + * + * @module logging + */ + + /** + * Enum specifying the levels of the logger + * + * @property levels + * @type Enum + * @for export + */ levels = _export("levels", { none: 0, error: 1, @@ -105,8 +146,25 @@ System.register([], function (_export) { appenders = []; slice = Array.prototype.slice; loggerConstructionKey = {}; + + /** + * The logger is essentially responsible for having log statements that appear during debugging but are squelched + * when using the build tools, depending on the log level that is set. The available levels are - + * 1. none + * 2. error + * 3. warn + * 4. info + * 5. debug + * + * You cannot instantiate the logger directly - you must use the getLogger method instead. + * + * @class Logger + * @constructor + */ Logger = _export("Logger", (function () { function Logger(id, key) { + _classCallCheck(this, Logger); + if (key !== loggerConstructionKey) { throw new Error("You cannot instantiate \"Logger\". Use the \"getLogger\" API instead."); } @@ -116,21 +174,53 @@ System.register([], function (_export) { _prototypeProperties(Logger, null, { debug: { + + /** + * Logs a debug message. + * + * @method debug + * @param {string} message The message to log + */ + value: function debug() {}, writable: true, configurable: true }, info: { + + /** + * Logs info. + * + * @method info + * @param {string} message The message to log + */ + value: function info() {}, writable: true, configurable: true }, warn: { + + /** + * Logs a warning. + * + * @method warn + * @param {string} message The message to log + */ + value: function warn() {}, writable: true, configurable: true }, error: { + + /** + * Logs an error. + * + * @method error + * @param {string} message The message to log + */ + value: function error() {}, writable: true, configurable: true diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index fa07115..37c71d9 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.2.4 (2015-02-27) + +* Updated compiler. + ### 0.2.3 (2015-02-18) @@ -20,4 +24,3 @@ * **build:** update compiler and switch to register module format ([7eb9aec5](http://github.com/aurelia/logging/commit/7eb9aec56eb616c2bbfbb38e59b8813f3f42a2e9)) * **logging:** Add new "none" log level. ([8f1ffdd6](http://github.com/aurelia/logging/commit/8f1ffdd6291c77874388944edc4a897d7078dcbd)) - diff --git a/package.json b/package.json index 575a6a9..9c93917 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-logging", - "version": "0.2.3", + "version": "0.2.4", "description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", "keywords": [ "aurelia",