backfill-logger
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -1,2 +0,10 @@ | ||
export declare type LogLevels = "error" | "warn" | "info" | "verbose" | "silly"; | ||
export declare const logLevelObject: { | ||
error: string; | ||
warn: string; | ||
info: string; | ||
verbose: string; | ||
silly: string; | ||
}; | ||
export declare type LogLevels = keyof typeof logLevelObject; | ||
export declare function isCorrectLogLevel(logLevel: string): logLevel is LogLevels; | ||
export declare function setLogLevel(newLogLevel: LogLevels): void; | ||
@@ -3,0 +11,0 @@ export interface Logger { |
@@ -5,4 +5,15 @@ "use strict"; | ||
function logInternal(method, symbol, ...args) { | ||
console[method]("[backfill]", symbol, ...args); | ||
console[method]("backfill:", symbol, ...args); | ||
} | ||
exports.logLevelObject = { | ||
error: "", | ||
warn: "", | ||
info: "", | ||
verbose: "", | ||
silly: "" | ||
}; | ||
function isCorrectLogLevel(logLevel) { | ||
return exports.logLevelObject.hasOwnProperty(logLevel); | ||
} | ||
exports.isCorrectLogLevel = isCorrectLogLevel; | ||
let logLevel = "info"; | ||
@@ -27,5 +38,2 @@ function setLogLevel(newLogLevel) { | ||
} | ||
const emptySquare = "\u25a1"; | ||
const square = "\u25a0"; | ||
const triangle = "\u25b2"; | ||
const performanceMarkers = {}; | ||
@@ -35,3 +43,3 @@ exports.logger = { | ||
if (logLevelNumber(logLevel) >= logLevelNumber("silly")) { | ||
logInternal("info", chalk_1.default.gray(emptySquare), ...args); | ||
logInternal("info", chalk_1.default.gray("\u25C7"), ...args); | ||
} | ||
@@ -41,3 +49,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("verbose")) { | ||
logInternal("info", chalk_1.default.white(emptySquare), ...args); | ||
logInternal("info", "\u25a1", ...args); | ||
} | ||
@@ -47,3 +55,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("info")) { | ||
logInternal("info", chalk_1.default.blue(square), ...args); | ||
logInternal("info", chalk_1.default.blue.bold("\u25a0"), ...args); | ||
} | ||
@@ -53,3 +61,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("warn")) { | ||
logInternal("warn", chalk_1.default.yellow(triangle), ...args); | ||
logInternal("warn", chalk_1.default.yellow.bold("\u25B2"), ...args); | ||
} | ||
@@ -70,3 +78,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("verbose")) { | ||
logInternal("info", chalk_1.default.cyan(square), `Profiling: '${chalk_1.default.cyanBright(marker)}' took ${chalk_1.default.cyanBright(`${ms}ms`)}`, ...args); | ||
logInternal("info", chalk_1.default.cyan("\u2023"), `Profiling ${chalk_1.default.underline(marker)} took ${chalk_1.default.cyanBright(`${ms}ms`)}`, ...args); | ||
} | ||
@@ -78,2 +86,2 @@ return ms; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJpY0xvZ2dlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9nZW5lcmljTG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsaUNBQTBCO0FBRTFCLFNBQVMsV0FBVyxDQUNsQixNQUFpQyxFQUNqQyxNQUFjLEVBQ2QsR0FBRyxJQUFXO0lBRWQsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLFlBQVksRUFBRSxNQUFNLEVBQUUsR0FBRyxJQUFJLENBQUMsQ0FBQztBQUNqRCxDQUFDO0FBSUQsSUFBSSxRQUFRLEdBQWMsTUFBTSxDQUFDO0FBRWpDLFNBQWdCLFdBQVcsQ0FBQyxXQUFzQjtJQUNoRCxRQUFRLEdBQUcsV0FBVyxDQUFDO0FBQ3pCLENBQUM7QUFGRCxrQ0FFQztBQUVELFNBQVMsY0FBYyxDQUFDLFFBQW1CO0lBQ3pDLFFBQVEsUUFBUSxFQUFFO1FBQ2hCLEtBQUssT0FBTztZQUNWLE9BQU8sQ0FBQyxDQUFDO1FBQ1gsS0FBSyx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UFDLEtBQUssQ0FBQyxDQUFDLENBQUMsR0FBRyxJQUFJLEdBQUcsS0FBSyxDQUFDLENBQUMsQ0FBQyxHQUFHLE9BQU8sQ0FBQyxDQUFDO2dCQUU1RCxJQUFJLGNBQWMsQ0FBQyxRQUFRLENBQUMsSUFBSSxjQUFjLENBQUMsU0FBUyxDQUFDLEVBQUU7b0JBQ3pELFdBQVcsQ0FDVCxNQUFNLEVBQ04sZUFBSyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsRUFDcEIsYUFBYSxlQUFLLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxTQUFTLGVBQUssQ0FBQyxVQUFVLENBQzNELEdBQUcsRUFBRSxJQUFJLENBQ1YsRUFBRSxFQUNILEdBQUcsSUFBSSxDQUNSLENBQUM7aUJBQ0g7Z0JBRUQsT0FBTyxFQUFFLENBQUM7YUFDWDtTQUNGO0lBQ0gsQ0FBQztDQUNGLENBQUMifQ== |
@@ -1,2 +0,2 @@ | ||
export { LogLevels, setLogLevel } from "./genericLogger"; | ||
export { LogLevels, setLogLevel, isCorrectLogLevel } from "./genericLogger"; | ||
export declare const logger: { | ||
@@ -3,0 +3,0 @@ setName(name: string): void; |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.setLogLevel = genericLogger_2.setLogLevel; | ||
exports.isCorrectLogLevel = genericLogger_2.isCorrectLogLevel; | ||
exports.logger = { | ||
@@ -12,2 +13,2 @@ ...genericLogger_1.logger, | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtREFBMEQ7QUFDMUQsdUVBQW9FO0FBRXBFLGlEQUF5RDtBQUFyQyxzQ0FBQSxXQUFXLENBQUE7QUFFbEIsUUFBQSxNQUFNLEdBQUc7SUFDcEIsR0FBRyxzQkFBYTtJQUNoQixHQUFHLGlEQUF1QjtDQUMzQixDQUFDIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtREFBMEQ7QUFDMUQsdUVBQW9FO0FBRXBFLGlEQUE0RTtBQUF4RCxzQ0FBQSxXQUFXLENBQUE7QUFBRSw0Q0FBQSxpQkFBaUIsQ0FBQTtBQUVyQyxRQUFBLE1BQU0sR0FBRztJQUNwQixHQUFHLHNCQUFhO0lBQ2hCLEdBQUcsaURBQXVCO0NBQzNCLENBQUMifQ== |
@@ -42,3 +42,3 @@ "use strict"; | ||
if (!(files instanceof Array)) { | ||
throw "Could not read performance logs. No report generated."; | ||
throw new Error("Could not read performance logs. No report generated."); | ||
} | ||
@@ -52,3 +52,3 @@ return files | ||
if (contents.length === 0) { | ||
throw "Found no performance logs. No report generated."; | ||
throw new Error("Found no performance logs. No report generated."); | ||
} | ||
@@ -95,2 +95,2 @@ fs.mkdirpSync(path.join(logFolder, "reports")); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVyZm9ybWFuY2VSZXBvcnRMb2dnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcGVyZm9ybWFuY2VSZXBvcnRMb2dnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx1Q0FBNkM7QUFDN0MsK0JBQStCO0FBQy9CLDZCQUE2QjtBQUU3QixtREFBeUM7QUFlekMsTUFBTSxxQkFBcUIsR0FBMEI7SUFDbkQsU0FBUyxFQUFFLElBQUksQ0FBQyxHQUFHLEVBQUU7Q0FDdEIsQ0FBQztBQUVGLFNBQVMsY0FBYzt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osQ0FBQztRQUNGLE1BQU0sSUFBSSxHQUFHLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsQ0FBQztRQUV2QyxJQUFJO1lBQ0YsTUFBTSxHQUFHLEdBQUcsZ0JBQVEsQ0FBQyxxQkFBcUIsRUFBRSxJQUFJLENBQUMsQ0FBQztZQUNsRCxNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxjQUFjLEVBQUUsQ0FBQyxDQUFDO1lBRXhELE1BQU0sRUFBRSxDQUFDLFVBQVUsQ0FBQyxRQUFRLEVBQUUsR0FBRyxDQUFDLENBQUM7WUFDbkMsc0JBQU0sQ0FBQyxLQUFLLENBQUMsOEJBQThCLFFBQVEsRUFBRSxDQUFDLENBQUM7U0FDeEQ7UUFBQyxPQUFPLEdBQUcsRUFBRTtZQUNaLHNCQUFNLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQ25CO0lBQ0gsQ0FBQztDQUNGLENBQUMifQ== |
@@ -10,22 +10,22 @@ { | ||
}, | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "yarn compile", | ||
"compile": "tsc", | ||
"compile": "tsc -b", | ||
"prepare": "yarn compile", | ||
"watch": "tsc -w" | ||
"watch": "tsc -b -w" | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.4.1", | ||
"fs-extra": "^7.0.1", | ||
"fs-extra": "^8.1.0", | ||
"json2csv": "^4.3.1" | ||
}, | ||
"devDependencies": { | ||
"@types/fs-extra": "^7.0.0", | ||
"@types/fs-extra": "^8.0.0", | ||
"@types/json2csv": "^4.2.0", | ||
"backfill-utils-tsconfig": "^2.0.2", | ||
"typescript": "3.5.3" | ||
"backfill-utils-tsconfig": "^2.0.3", | ||
"typescript": "3.6.4" | ||
}, | ||
"gitHead": "b53edf4df12efaadb24bf4b6d50b55ad29223a63" | ||
"gitHead": "ab03bda7c47d6c765ab891402e5fdb9a3abf34f5" | ||
} |
@@ -8,7 +8,19 @@ import chalk from "chalk"; | ||
) { | ||
console[method]("[backfill]", symbol, ...args); | ||
console[method]("backfill:", symbol, ...args); | ||
} | ||
export type LogLevels = "error" | "warn" | "info" | "verbose" | "silly"; | ||
export const logLevelObject = { | ||
error: "", | ||
warn: "", | ||
info: "", | ||
verbose: "", | ||
silly: "" | ||
}; | ||
export type LogLevels = keyof typeof logLevelObject; | ||
export function isCorrectLogLevel(logLevel: string): logLevel is LogLevels { | ||
return logLevelObject.hasOwnProperty(logLevel); | ||
} | ||
let logLevel: LogLevels = "info"; | ||
@@ -44,6 +56,2 @@ | ||
const emptySquare = "\u25a1"; | ||
const square = "\u25a0"; | ||
const triangle = "\u25b2"; | ||
const performanceMarkers: { [marker: string]: [number, number] } = {}; | ||
@@ -54,3 +62,3 @@ | ||
if (logLevelNumber(logLevel) >= logLevelNumber("silly")) { | ||
logInternal("info", chalk.gray(emptySquare), ...args); | ||
logInternal("info", chalk.gray("\u25C7"), ...args); | ||
} | ||
@@ -61,3 +69,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("verbose")) { | ||
logInternal("info", chalk.white(emptySquare), ...args); | ||
logInternal("info", "\u25a1", ...args); | ||
} | ||
@@ -68,3 +76,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("info")) { | ||
logInternal("info", chalk.blue(square), ...args); | ||
logInternal("info", chalk.blue.bold("\u25a0"), ...args); | ||
} | ||
@@ -75,3 +83,3 @@ }, | ||
if (logLevelNumber(logLevel) >= logLevelNumber("warn")) { | ||
logInternal("warn", chalk.yellow(triangle), ...args); | ||
logInternal("warn", chalk.yellow.bold("\u25B2"), ...args); | ||
} | ||
@@ -97,4 +105,4 @@ }, | ||
"info", | ||
chalk.cyan(square), | ||
`Profiling: '${chalk.cyanBright(marker)}' took ${chalk.cyanBright( | ||
chalk.cyan("\u2023"), | ||
`Profiling ${chalk.underline(marker)} took ${chalk.cyanBright( | ||
`${ms}ms` | ||
@@ -101,0 +109,0 @@ )}`, |
import { logger as genericLogger } from "./genericLogger"; | ||
import { performanceReportLogger } from "./performanceReportLogger"; | ||
export { LogLevels, setLogLevel } from "./genericLogger"; | ||
export { LogLevels, setLogLevel, isCorrectLogLevel } from "./genericLogger"; | ||
@@ -6,0 +6,0 @@ export const logger = { |
@@ -69,3 +69,5 @@ import { parse as json2csv } from "json2csv"; | ||
if (!(files instanceof Array)) { | ||
throw "Could not read performance logs. No report generated."; | ||
throw new Error( | ||
"Could not read performance logs. No report generated." | ||
); | ||
} | ||
@@ -80,3 +82,3 @@ | ||
if (contents.length === 0) { | ||
throw "Found no performance logs. No report generated."; | ||
throw new Error("Found no performance logs. No report generated."); | ||
} | ||
@@ -83,0 +85,0 @@ |
{ | ||
"extends": "backfill-utils-tsconfig/tsconfig.default.json", | ||
"include": ["src/**/*"], | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "lib" | ||
} | ||
"include": ["src"], | ||
"compilerOptions": { "rootDir": "src", "outDir": "lib" }, | ||
"references": [] | ||
} |
Sorry, the diff of this file is not supported yet
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
145273
17
446
+ Addedfs-extra@8.1.0(transitive)
- Removedfs-extra@7.0.1(transitive)
Updatedfs-extra@^8.1.0