From 83c228c02ca7573928876099f421e7279a173e1d Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Thu, 9 Apr 2015 00:08:25 -0400 Subject: [PATCH] chore(all): prepare release 0.3.0 --- bower.json | 2 +- dist/amd/index.js | 166 ++++++++------------------------------ dist/commonjs/index.js | 158 +++++++----------------------------- dist/system/index.js | 177 ++++++++++------------------------------- doc/CHANGELOG.md | 8 ++ package.json | 2 +- 6 files changed, 115 insertions(+), 398 deletions(-) diff --git a/bower.json b/bower.json index 746866c..c038056 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-logging", - "version": "0.2.7", + "version": "0.3.0", "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 9d53034..45c5b79 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -1,51 +1,16 @@ -define(["exports"], function (exports) { - "use strict"; - - 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"); } }; - - /** - * 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 - */ - - /** - * Creates an instance of Error that aggregates and preserves an innerError. - * - * @class AggregateError - * @constructor - */ - exports.AggregateError = AggregateError; +define(['exports'], function (exports) { + 'use strict'; - /** - * 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; + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - /** - * 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; + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - /** - * 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 - */ + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.AggregateError = AggregateError; + exports.getLogger = getLogger; + exports.addAppender = addAppender; exports.setLevel = setLevel; function AggregateError(msg, inner, skipIfAlreadyAggregate) { @@ -55,7 +20,7 @@ define(["exports"], function (exports) { } if (inner.stack) { - msg += "\n------------------------------------------------\ninner error: " + inner.stack; + msg += '\n------------------------------------------------\ninner error: ' + inner.stack; } } @@ -67,14 +32,7 @@ define(["exports"], function (exports) { return err; } - /** - * Enum specifying the levels of the logger - * - * @property levels - * @type Enum - * @for export - */ - var levels = exports.levels = { + var levels = { none: 0, error: 1, warn: 2, @@ -82,6 +40,7 @@ define(["exports"], function (exports) { debug: 4 }; + exports.levels = levels; var loggers = {}, logLevel = levels.none, appenders = [], @@ -106,7 +65,7 @@ define(["exports"], function (exports) { return; } - log(this, "debug", arguments); + log(this, 'debug', arguments); } function info() { @@ -114,7 +73,7 @@ define(["exports"], function (exports) { return; } - log(this, "info", arguments); + log(this, 'info', arguments); } function warn() { @@ -122,7 +81,7 @@ define(["exports"], function (exports) { return; } - log(this, "warn", arguments); + log(this, 'warn', arguments); } function error() { @@ -130,7 +89,7 @@ define(["exports"], function (exports) { return; } - log(this, "error", arguments); + log(this, 'error', arguments); } function connectLogger(logger) { @@ -149,6 +108,7 @@ define(["exports"], function (exports) { return logger; } + function getLogger(id) { return loggers[id] || (loggers[id] = createLogger(id)); } @@ -167,91 +127,33 @@ 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 () { + var Logger = (function () { function Logger(id, key) { _classCallCheck(this, Logger); if (key !== loggerConstructionKey) { - throw new Error("You cannot instantiate \"Logger\". Use the \"getLogger\" API instead."); + throw new Error('You cannot instantiate "Logger". Use the "getLogger" API instead.'); } this.id = id; } - _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 - } - }); + _createClass(Logger, [{ + key: 'debug', + value: function debug() {} + }, { + key: 'info', + value: function info() {} + }, { + key: 'warn', + value: function warn() {} + }, { + key: 'error', + value: function error() {} + }]); return Logger; })(); - Object.defineProperty(exports, "__esModule", { - value: true - }); + exports.Logger = Logger; }); \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 21522ad..ccfb956 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -1,50 +1,15 @@ -"use strict"; +'use strict'; -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'); } }; -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); -/** - * 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 - */ - -/** -* Creates an instance of Error that aggregates and preserves an innerError. -* -* @class AggregateError -* @constructor -*/ +Object.defineProperty(exports, '__esModule', { + value: true +}); exports.AggregateError = AggregateError; - -/** -* 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; function AggregateError(msg, inner, skipIfAlreadyAggregate) { @@ -54,7 +19,7 @@ function AggregateError(msg, inner, skipIfAlreadyAggregate) { } if (inner.stack) { - msg += "\n------------------------------------------------\ninner error: " + inner.stack; + msg += '\n------------------------------------------------\ninner error: ' + inner.stack; } } @@ -66,14 +31,7 @@ function AggregateError(msg, inner, skipIfAlreadyAggregate) { return err; } -/** -* Enum specifying the levels of the logger -* -* @property levels -* @type Enum -* @for export -*/ -var levels = exports.levels = { +var levels = { none: 0, error: 1, warn: 2, @@ -81,6 +39,7 @@ var levels = exports.levels = { debug: 4 }; +exports.levels = levels; var loggers = {}, logLevel = levels.none, appenders = [], @@ -105,7 +64,7 @@ function debug() { return; } - log(this, "debug", arguments); + log(this, 'debug', arguments); } function info() { @@ -113,7 +72,7 @@ function info() { return; } - log(this, "info", arguments); + log(this, 'info', arguments); } function warn() { @@ -121,7 +80,7 @@ function warn() { return; } - log(this, "warn", arguments); + log(this, 'warn', arguments); } function error() { @@ -129,7 +88,7 @@ function error() { return; } - log(this, "error", arguments); + log(this, 'error', arguments); } function connectLogger(logger) { @@ -148,6 +107,7 @@ function createLogger(id) { return logger; } + function getLogger(id) { return loggers[id] || (loggers[id] = createLogger(id)); } @@ -166,90 +126,32 @@ 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 () { +var Logger = (function () { function Logger(id, key) { _classCallCheck(this, Logger); if (key !== loggerConstructionKey) { - throw new Error("You cannot instantiate \"Logger\". Use the \"getLogger\" API instead."); + throw new Error('You cannot instantiate "Logger". Use the "getLogger" API instead.'); } this.id = id; } - _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 - } - }); + _createClass(Logger, [{ + key: 'debug', + value: function debug() {} + }, { + key: 'info', + value: function info() {} + }, { + key: 'warn', + value: function warn() {} + }, { + key: 'error', + value: function error() {} + }]); return Logger; })(); -Object.defineProperty(exports, "__esModule", { - value: true -}); \ No newline at end of file +exports.Logger = Logger; \ No newline at end of file diff --git a/dist/system/index.js b/dist/system/index.js index 50ea8af..994e473 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -1,52 +1,13 @@ System.register([], function (_export) { - var _prototypeProperties, _classCallCheck, levels, loggers, logLevel, appenders, slice, loggerConstructionKey, Logger; - - /** - * 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 - */ - - /** - * Creates an instance of Error that aggregates and preserves an innerError. - * - * @class AggregateError - * @constructor - */ - - _export("AggregateError", AggregateError); - - /** - * 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 - */ - - _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); + var _classCallCheck, _createClass, levels, loggers, logLevel, appenders, slice, loggerConstructionKey, Logger; + + _export('AggregateError', AggregateError); + + _export('getLogger', getLogger); + + _export('addAppender', addAppender); + + _export('setLevel', setLevel); function AggregateError(msg, inner, skipIfAlreadyAggregate) { if (inner) { @@ -55,7 +16,7 @@ System.register([], function (_export) { } if (inner.stack) { - msg += "\n------------------------------------------------\ninner error: " + inner.stack; + msg += '\n------------------------------------------------\ninner error: ' + inner.stack; } } @@ -85,7 +46,7 @@ System.register([], function (_export) { return; } - log(this, "debug", arguments); + log(this, 'debug', arguments); } function info() { @@ -93,7 +54,7 @@ System.register([], function (_export) { return; } - log(this, "info", arguments); + log(this, 'info', arguments); } function warn() { @@ -101,7 +62,7 @@ System.register([], function (_export) { return; } - log(this, "warn", arguments); + log(this, 'warn', arguments); } function error() { @@ -109,7 +70,7 @@ System.register([], function (_export) { return; } - log(this, "error", arguments); + log(this, 'error', arguments); } function connectLogger(logger) { @@ -128,6 +89,7 @@ System.register([], function (_export) { return logger; } + function getLogger(id) { return loggers[id] || (loggers[id] = createLogger(id)); } @@ -149,114 +111,57 @@ System.register([], function (_export) { return { setters: [], execute: function () { - "use strict"; + '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'); } }; - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - /** - * Enum specifying the levels of the logger - * - * @property levels - * @type Enum - * @for export - */ - levels = _export("levels", { + levels = { none: 0, error: 1, warn: 2, info: 3, debug: 4 - }); + }; + + _export('levels', levels); + loggers = {}; logLevel = levels.none; 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 () { + Logger = (function () { function Logger(id, key) { _classCallCheck(this, Logger); if (key !== loggerConstructionKey) { - throw new Error("You cannot instantiate \"Logger\". Use the \"getLogger\" API instead."); + throw new Error('You cannot instantiate "Logger". Use the "getLogger" API instead.'); } this.id = id; } - _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 - } - }); + _createClass(Logger, [{ + key: 'debug', + value: function debug() {} + }, { + key: 'info', + value: function info() {} + }, { + key: 'warn', + value: function warn() {} + }, { + key: 'error', + value: function error() {} + }]); return Logger; - })()); + })(); + + _export('Logger', Logger); } }; }); \ No newline at end of file diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 9661988..0b7e519 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.3.0 (2015-04-09) + + +#### Bug Fixes + +* **all:** update compiler ([ffe2e20f](http://github.com/aurelia/logging/commit/ffe2e20f0249b0cd1d7378ec42ca07df63b61ed0)) + + ### 0.2.7 (2015-03-27) diff --git a/package.json b/package.json index 006bdb1..6b91b2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-logging", - "version": "0.2.7", + "version": "0.3.0", "description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", "keywords": [ "aurelia",