Comparing version 1.1.6 to 1.1.7
@@ -13,13 +13,6 @@ /*! | ||
export declare type LevelTitle = 'ERR' | 'WARN' | 'INFO' | 'VERB' | 'SILL'; | ||
export declare enum LogLevel { | ||
silent = 0, | ||
error = 1, | ||
warn = 2, | ||
info = 3, | ||
verbose = 4, | ||
silly = 5, | ||
} | ||
export declare class Brolog { | ||
private logLevel; | ||
private prefixFilter; | ||
private static _instance; | ||
constructor(); | ||
@@ -47,3 +40,1 @@ /** | ||
} | ||
export declare const sharedInstance: Brolog; | ||
export default sharedInstance; |
@@ -19,2 +19,5 @@ /*! | ||
} | ||
else { // http://stackoverflow.com/questions/36935177/umd-syntax-with-fallback-global | ||
factory(null, window) | ||
} | ||
})(function (require, exports) { | ||
@@ -31,3 +34,3 @@ "use strict"; | ||
LogLevel[LogLevel["silly"] = 5] = "silly"; | ||
})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); | ||
})(LogLevel || (LogLevel = {})); | ||
var Brolog = (function () { | ||
@@ -37,3 +40,3 @@ function Brolog() { | ||
this.prefixFilter = /.*/; // Match all by default | ||
var instance = Brolog.instance(); | ||
var instance = Brolog._instance; | ||
if (instance) { | ||
@@ -50,9 +53,12 @@ // set level/prefix of this instance | ||
Brolog.instance = function (levelName, prefix) { | ||
if (!this._instance) { | ||
this._instance = new Brolog(); | ||
} | ||
if (levelName) { | ||
exports.sharedInstance.level(levelName); | ||
this._instance.level(levelName); | ||
} | ||
if (prefix) { | ||
exports.sharedInstance.prefix(prefix); | ||
this._instance.prefix(prefix); | ||
} | ||
return exports.sharedInstance; | ||
return this._instance; | ||
}; | ||
@@ -233,12 +239,3 @@ Brolog.prefix = function (filter) { | ||
exports.Brolog = Brolog; | ||
/** | ||
* install UMD module to browser global window | ||
* http://stackoverflow.com/a/35298272/1123955 | ||
*/ | ||
if (typeof window !== 'undefined') { | ||
window.Brolog = Brolog; | ||
} | ||
exports.sharedInstance = new Brolog(); | ||
exports.default = exports.sharedInstance; | ||
}); | ||
//# sourceMappingURL=brolog.js.map |
@@ -13,13 +13,6 @@ /*! | ||
export declare type LevelTitle = 'ERR' | 'WARN' | 'INFO' | 'VERB' | 'SILL'; | ||
export declare enum LogLevel { | ||
silent = 0, | ||
error = 1, | ||
warn = 2, | ||
info = 3, | ||
verbose = 4, | ||
silly = 5, | ||
} | ||
export declare class Brolog { | ||
private logLevel; | ||
private prefixFilter; | ||
private static _instance; | ||
constructor(); | ||
@@ -47,3 +40,1 @@ /** | ||
} | ||
export declare const sharedInstance: Brolog; | ||
export default sharedInstance; |
@@ -21,3 +21,3 @@ "use strict"; | ||
LogLevel[LogLevel["silly"] = 5] = "silly"; | ||
})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); | ||
})(LogLevel || (LogLevel = {})); | ||
class Brolog { | ||
@@ -27,3 +27,3 @@ constructor() { | ||
this.prefixFilter = /.*/; // Match all by default | ||
const instance = Brolog.instance(); | ||
const instance = Brolog._instance; | ||
if (instance) { | ||
@@ -40,9 +40,12 @@ // set level/prefix of this instance | ||
static instance(levelName, prefix) { | ||
if (!this._instance) { | ||
this._instance = new Brolog(); | ||
} | ||
if (levelName) { | ||
exports.sharedInstance.level(levelName); | ||
this._instance.level(levelName); | ||
} | ||
if (prefix) { | ||
exports.sharedInstance.prefix(prefix); | ||
this._instance.prefix(prefix); | ||
} | ||
return exports.sharedInstance; | ||
return this._instance; | ||
} | ||
@@ -182,11 +185,2 @@ static prefix(filter) { | ||
exports.Brolog = Brolog; | ||
/** | ||
* install UMD module to browser global window | ||
* http://stackoverflow.com/a/35298272/1123955 | ||
*/ | ||
if (typeof window !== 'undefined') { | ||
window.Brolog = Brolog; | ||
} | ||
exports.sharedInstance = new Brolog(); | ||
exports.default = exports.sharedInstance; | ||
//# sourceMappingURL=brolog.js.map |
{ | ||
"name": "brolog", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "Npmlog like logger for Browser", | ||
@@ -11,5 +11,6 @@ "main": "bundles/brolog.js", | ||
"build": "tsc", | ||
"build:umd": "tsc --target es5 --module umd --outDir bundles/", | ||
"build:umd": "tsc --target es5 --module umd --outDir bundles/ && npm run patch", | ||
"build:amd:deprecated": "tsc --module amd --outDir dist/amd", | ||
"build:system:deprecated": "tsc --module system --outDir dist/system", | ||
"patch": "patch < patch/umd.patch bundles/brolog.js", | ||
"e2e": "test/protractor.sh", | ||
@@ -16,0 +17,0 @@ "lint": "npm run tslint", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38014
492