@sapphire/plugin-logger 4.0.3-next.68a7a96.0 → 4.0.3-next.7909d16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +13 -13
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/lib/Logger.cjs +3 -3
- package/dist/cjs/lib/LoggerLevel.cjs +4 -4
- package/dist/cjs/lib/LoggerTimestamp.cjs +2 -2
- package/dist/cjs/register.cjs +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var Logger_mjs = require('./lib/Logger.mjs');
|
|
4
|
+
var LoggerLevel_mjs = require('./lib/LoggerLevel.mjs');
|
|
5
|
+
var LoggerStyle_mjs = require('./lib/LoggerStyle.mjs');
|
|
6
|
+
var LoggerTimestamp_mjs = require('./lib/LoggerTimestamp.mjs');
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
|
-
var version = "4.0.3-next.
|
|
9
|
+
var version = "4.0.3-next.7909d16.0";
|
|
10
10
|
|
|
11
11
|
exports.version = version;
|
|
12
|
-
Object.keys(
|
|
12
|
+
Object.keys(Logger_mjs).forEach(function (k) {
|
|
13
13
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return Logger_mjs[k]; }
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
-
Object.keys(
|
|
18
|
+
Object.keys(LoggerLevel_mjs).forEach(function (k) {
|
|
19
19
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return LoggerLevel_mjs[k]; }
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
Object.keys(
|
|
24
|
+
Object.keys(LoggerStyle_mjs).forEach(function (k) {
|
|
25
25
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return LoggerStyle_mjs[k]; }
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
Object.keys(
|
|
30
|
+
Object.keys(LoggerTimestamp_mjs).forEach(function (k) {
|
|
31
31
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return LoggerTimestamp_mjs[k]; }
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
//# sourceMappingURL=out.js.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAaP,IAAM,UAAkB","sourcesContent":["import type { LoggerOptions } from './lib/Logger';\n\nexport * from './lib/Logger';\nexport * from './lib/LoggerLevel';\nexport * from './lib/LoggerStyle';\nexport * from './lib/LoggerTimestamp';\n\ndeclare module '@sapphire/framework' {\n\texport interface ClientLoggerOptions extends LoggerOptions {}\n}\n\n/**\n * The [@sapphire/plugin-logger](https://github.com/sapphiredev/plugins/blob/main/packages/logger) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '4.0.3-next.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAaP,IAAM,UAAkB","sourcesContent":["import type { LoggerOptions } from './lib/Logger';\n\nexport * from './lib/Logger';\nexport * from './lib/LoggerLevel';\nexport * from './lib/LoggerStyle';\nexport * from './lib/LoggerTimestamp';\n\ndeclare module '@sapphire/framework' {\n\texport interface ClientLoggerOptions extends LoggerOptions {}\n}\n\n/**\n * The [@sapphire/plugin-logger](https://github.com/sapphiredev/plugins/blob/main/packages/logger) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '4.0.3-next.7909d16.0';\n"]}
|
package/dist/cjs/lib/Logger.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var framework = require('@sapphire/framework');
|
|
|
4
4
|
var colorette = require('colorette');
|
|
5
5
|
var console = require('console');
|
|
6
6
|
var util = require('util');
|
|
7
|
-
var
|
|
7
|
+
var LoggerLevel_mjs = require('./LoggerLevel.mjs');
|
|
8
8
|
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -85,8 +85,8 @@ var _Logger = class _Logger extends framework.Logger {
|
|
|
85
85
|
}
|
|
86
86
|
static ensureDefaultLevel(options, defaults, color, name) {
|
|
87
87
|
if (options)
|
|
88
|
-
return new
|
|
89
|
-
return new
|
|
88
|
+
return new LoggerLevel_mjs.LoggerLevel(options);
|
|
89
|
+
return new LoggerLevel_mjs.LoggerLevel({
|
|
90
90
|
...defaults,
|
|
91
91
|
timestamp: defaults.timestamp === null ? null : { ...defaults.timestamp ?? {}, color },
|
|
92
92
|
infix: name.length ? `${color(name.padEnd(5, " "))} - ` : ""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var LoggerStyle_mjs = require('./LoggerStyle.mjs');
|
|
4
|
+
var LoggerTimestamp_mjs = require('./LoggerTimestamp.mjs');
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -27,9 +27,9 @@ var _LoggerLevel = class _LoggerLevel {
|
|
|
27
27
|
* @since 1.0.0
|
|
28
28
|
*/
|
|
29
29
|
__publicField(this, "message");
|
|
30
|
-
this.timestamp = options.timestamp === null ? null : new
|
|
30
|
+
this.timestamp = options.timestamp === null ? null : new LoggerTimestamp_mjs.LoggerTimestamp(options.timestamp);
|
|
31
31
|
this.infix = options.infix ?? "";
|
|
32
|
-
this.message = options.message === null ? null : new
|
|
32
|
+
this.message = options.message === null ? null : new LoggerStyle_mjs.LoggerStyle(options.message);
|
|
33
33
|
}
|
|
34
34
|
run(content) {
|
|
35
35
|
const prefix = (this.timestamp?.run() ?? "") + this.infix;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var timestamp = require('@sapphire/timestamp');
|
|
4
|
-
var
|
|
4
|
+
var LoggerStyle_mjs = require('./LoggerStyle.mjs');
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -34,7 +34,7 @@ var _LoggerTimestamp = class _LoggerTimestamp {
|
|
|
34
34
|
__publicField(this, "formatter");
|
|
35
35
|
this.timestamp = new timestamp.Timestamp(options.pattern ?? "YYYY-MM-DD HH:mm:ss");
|
|
36
36
|
this.utc = options.utc ?? false;
|
|
37
|
-
this.color = options.color === null ? null : new
|
|
37
|
+
this.color = options.color === null ? null : new LoggerStyle_mjs.LoggerStyle(options.color);
|
|
38
38
|
this.formatter = options.formatter ?? ((timestamp) => `${timestamp} - `);
|
|
39
39
|
}
|
|
40
40
|
/**
|
package/dist/cjs/register.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var index_mjs = require('./index.mjs');
|
|
4
4
|
var framework = require('@sapphire/framework');
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
@@ -11,7 +11,7 @@ var _LoggerPlugin = class _LoggerPlugin extends framework.Plugin {
|
|
|
11
11
|
*/
|
|
12
12
|
static [framework.preGenericsInitialization](options) {
|
|
13
13
|
options.logger ??= {};
|
|
14
|
-
options.logger.instance = new
|
|
14
|
+
options.logger.instance = new index_mjs.Logger(options.logger);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
__name(_LoggerPlugin, "LoggerPlugin");
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAaP,IAAM,UAAkB","sourcesContent":["import type { LoggerOptions } from './lib/Logger';\n\nexport * from './lib/Logger';\nexport * from './lib/LoggerLevel';\nexport * from './lib/LoggerStyle';\nexport * from './lib/LoggerTimestamp';\n\ndeclare module '@sapphire/framework' {\n\texport interface ClientLoggerOptions extends LoggerOptions {}\n}\n\n/**\n * The [@sapphire/plugin-logger](https://github.com/sapphiredev/plugins/blob/main/packages/logger) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '4.0.3-next.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAaP,IAAM,UAAkB","sourcesContent":["import type { LoggerOptions } from './lib/Logger';\n\nexport * from './lib/Logger';\nexport * from './lib/LoggerLevel';\nexport * from './lib/LoggerStyle';\nexport * from './lib/LoggerTimestamp';\n\ndeclare module '@sapphire/framework' {\n\texport interface ClientLoggerOptions extends LoggerOptions {}\n}\n\n/**\n * The [@sapphire/plugin-logger](https://github.com/sapphiredev/plugins/blob/main/packages/logger) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '4.0.3-next.7909d16.0';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/plugin-logger",
|
|
3
|
-
"version": "4.0.3-next.
|
|
3
|
+
"version": "4.0.3-next.7909d16.0",
|
|
4
4
|
"description": "Plugin for @sapphire/framework to have pretty console output",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@favware/rollup-type-bundler": "^3.3.0",
|
|
87
87
|
"concurrently": "^8.2.2",
|
|
88
88
|
"tsup": "^8.0.2",
|
|
89
|
-
"tsx": "^4.
|
|
89
|
+
"tsx": "^4.10.5",
|
|
90
90
|
"typedoc": "^0.25.13",
|
|
91
91
|
"typedoc-json-parser": "^10.0.0",
|
|
92
92
|
"typescript": "^5.4.5"
|