From f06ce4c444ce60cb5f579ef7993e1070dc70d810 Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Mon, 18 Sep 2023 15:26:46 +0530 Subject: [PATCH] log: drop undocumented printYaml config option --- CHANGELOG.md | 1 + package-lock.json | 32 +++++++------------------------- package.json | 1 - src/log.ts | 20 +++----------------- 4 files changed, 11 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63ae487..9d4dc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Only breaking changes, deprecations and the like are documented in this change l - bot.date -> bot.Date - Class for querying Wikimedia EventStreams have been removed. Consider using the dedicated library [wikimedia-streams](https://www.npmjs.com/package/wikimedia-streams) instead. - set* methods on MwnDate objects (eg. `setUTCDate`) used to be chainable as they returned `this`. Because MwnDate extends the native Date, the change in return values was not possible to represent in TypeScript types ([Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle)). This undocumented feature has now been removed for the sake of accurate types. +- `printYaml` logging config option used by is no longer supported in Mwn.setLoggingConfig() method. - mwn#queryAuthors() which had been deprecated has now been removed. Instead, please use `queryAuthors()` method on page objects. #### 0.11.0 diff --git a/package-lock.json b/package-lock.json index 44370a1..f16e53f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "chalk": "^1.1.3", "form-data": "^3.0.0", "oauth-1.0a": "^2.2.6", - "prettyjson": "^1.1.3", "tough-cookie": "^4.0.0", "types-mediawiki": "^1.0.0" }, @@ -1917,6 +1916,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, "engines": { "node": ">=0.1.90" } @@ -5724,7 +5724,8 @@ "node_modules/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true }, "node_modules/mixin-deep": { "version": "1.3.2", @@ -6866,18 +6867,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/prettyjson": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", - "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", - "dependencies": { - "colors": "^1.1.2", - "minimist": "^1.2.0" - }, - "bin": { - "prettyjson": "bin/prettyjson" - } - }, "node_modules/process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", @@ -10881,7 +10870,8 @@ "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -13777,7 +13767,8 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true }, "mixin-deep": { "version": "1.3.2", @@ -14659,15 +14650,6 @@ } } }, - "prettyjson": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", - "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", - "requires": { - "colors": "^1.1.2", - "minimist": "^1.2.0" - } - }, "process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", diff --git a/package.json b/package.json index 47ac05d..3968eda 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "chalk": "^1.1.3", "form-data": "^3.0.0", "oauth-1.0a": "^2.2.6", - "prettyjson": "^1.1.3", "tough-cookie": "^4.0.0", "types-mediawiki": "^1.0.0" }, diff --git a/src/log.ts b/src/log.ts index 91d9045..0ea5799 100644 --- a/src/log.ts +++ b/src/log.ts @@ -12,10 +12,8 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const chalk = require('chalk'); -const prettyjson = require('prettyjson'); export const logConfig = { - printYaml: false, printDebug: true, printVerbose: true, }; @@ -75,21 +73,9 @@ export function message(msg: item) { * @param obj */ export function debug(obj: item) { - if (logConfig.printYaml) { - // Print YAML - let options = { - keysColor: 'white', - dashColor: 'white', - stringColor: 'yellow', - numberColor: 'blue', - }; - - console.log(chalk.gray('---\n') + prettyjson.render(obj, options)); - } else { - // Print indented JSON - let msg = JSON.stringify(obj, null, 4); - console.log(chalk.gray(msg)); - } + // Print indented JSON + let msg = JSON.stringify(obj, null, 4); + console.log(chalk.gray(msg)); } /**