@betterer/logger
Advanced tools
Comparing version 2.0.1 to 2.2.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [2.2.0](https://github.com/phenomnomnominal/betterer/compare/v2.1.0...v2.2.0) (2020-06-28) | ||
### Features | ||
* **betterer ✨:** create per contributor score from git history of result file ([#131](https://github.com/phenomnomnominal/betterer/issues/131)) ([bc288c4](https://github.com/phenomnomnominal/betterer/commit/bc288c4eacb6f7cdc37580f430287a39ae7a4ad0)) | ||
* **logger ✨:** add `silent` config option and `--silent` flag ([#127](https://github.com/phenomnomnominal/betterer/issues/127)) ([816fe34](https://github.com/phenomnomnominal/betterer/commit/816fe34c888096c1c967705f4855a44851a30b4a)) | ||
## [2.0.1](https://github.com/phenomnomnominal/betterer/compare/v2.0.0...v2.0.1) (2020-06-24) | ||
@@ -8,0 +20,0 @@ |
@@ -1,2 +0,2 @@ | ||
export { br, code, error, info, logo, overwrite, success, warn } from './logger'; | ||
export { br, code, error, info, logo, overwrite, success, warn, unmute, mute, debug } from './logger'; | ||
export * from './types'; |
@@ -13,3 +13,6 @@ "use strict"; | ||
Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return logger_1.warn; } }); | ||
Object.defineProperty(exports, "unmute", { enumerable: true, get: function () { return logger_1.unmute; } }); | ||
Object.defineProperty(exports, "mute", { enumerable: true, get: function () { return logger_1.mute; } }); | ||
Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return logger_1.debug; } }); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
import { BettererLogger, BettererLoggerCodeInfo, BettererLoggerOverwriteDone } from './types'; | ||
export declare function mute(): void; | ||
export declare function unmute(): void; | ||
export declare function logo(): void; | ||
export declare function br(): void; | ||
export declare const debug: BettererLogger; | ||
export declare const success: BettererLogger; | ||
@@ -5,0 +8,0 @@ export declare const info: BettererLogger; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.overwrite = exports.code = exports.error = exports.warn = exports.info = exports.success = exports.br = exports.logo = void 0; | ||
exports.overwrite = exports.code = exports.error = exports.warn = exports.info = exports.success = exports.debug = exports.br = exports.logo = exports.unmute = exports.mute = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -14,8 +14,17 @@ var code_frame_1 = require("@babel/code-frame"); | ||
var NEW_LINE = '\n'; | ||
var muted = false; | ||
function mute() { | ||
muted = true; | ||
} | ||
exports.mute = mute; | ||
function unmute() { | ||
muted = false; | ||
} | ||
exports.unmute = unmute; | ||
function logo() { | ||
console.log(LOGO); | ||
log(LOGO); | ||
} | ||
exports.logo = logo; | ||
function br() { | ||
console.log(''); | ||
log(''); | ||
} | ||
@@ -25,2 +34,3 @@ exports.br = br; | ||
var previousLogger = 'LOG'; | ||
exports.debug = createLogger(chalk.bgBlue.white(' debg '), chalk.bgBlack(' 🤔 ')); | ||
exports.success = createLogger(chalk.bgGreenBright.black(' succ '), chalk.bgBlack(' ✅ ')); | ||
@@ -31,2 +41,12 @@ exports.info = createLogger(chalk.bgWhiteBright.black(' info '), chalk.bgBlack(' 💬 ')); | ||
var SPACER = chalk.bgBlack.yellowBright(' - '); | ||
function log() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
if (!muted) { | ||
// eslint-disable-next-line no-console | ||
console.log.apply(console, args); | ||
} | ||
} | ||
function createLogger(name, icon) { | ||
@@ -41,3 +61,3 @@ return function () { | ||
} | ||
console.log.apply(console, tslib_1.__spreadArrays(["" + HEADING + name + icon + SPACER], messages.map(function (m) { return chalk.whiteBright(m); }))); | ||
log.apply(void 0, tslib_1.__spreadArrays(["" + HEADING + name + icon + SPACER], messages.map(function (m) { return chalk.whiteBright(m); }))); | ||
previousLogger = 'LOG'; | ||
@@ -65,7 +85,9 @@ }; | ||
var codeMessage = chalk.bgBlack.white(" " + message + " " + NEW_LINE); | ||
console.log("" + NEW_LINE + ERROR_BLOCK + codeMessage + codeFrame); | ||
log("" + NEW_LINE + ERROR_BLOCK + codeMessage + codeFrame); | ||
previousLogger = 'CODE'; | ||
}; | ||
function overwrite(content) { | ||
logUpdate("" + LOGO + NEW_LINE + content); | ||
if (!muted) { | ||
logUpdate("" + LOGO + NEW_LINE + content); | ||
} | ||
return logUpdate.done.bind(logUpdate); | ||
@@ -72,0 +94,0 @@ } |
{ | ||
"name": "@betterer/logger", | ||
"description": "logger for @betterer/betterer", | ||
"version": "2.0.1", | ||
"version": "2.2.0", | ||
"license": "MIT", | ||
@@ -38,3 +38,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "5375664e8a3c6405fa98ca59ddb906ae910016f7" | ||
"gitHead": "2167a20ba62a488d24fc6f76fc7b160e51a0231f" | ||
} |
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
14499
133