@rdyl/node-koa-controller 0.4.0 → 0.4.1
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/CHANGELOG.md +1 -1
- package/dist/utils.js +2 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/utils.js
CHANGED
|
@@ -101,7 +101,7 @@ function getIPAdress() {
|
|
|
101
101
|
}
|
|
102
102
|
function LogsHandler(ctx, next) {
|
|
103
103
|
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
-
var start, duration, status_1, method, statusColor,
|
|
104
|
+
var start, duration, status_1, method, statusColor, dText;
|
|
105
105
|
return __generator(this, function (_a) {
|
|
106
106
|
switch (_a.label) {
|
|
107
107
|
case 0:
|
|
@@ -128,7 +128,6 @@ function LogsHandler(ctx, next) {
|
|
|
128
128
|
statusColor = chalk_1.default.green;
|
|
129
129
|
else
|
|
130
130
|
statusColor = chalk_1.default.gray;
|
|
131
|
-
dateTime = formatDateTime();
|
|
132
131
|
dText = chalk_1.default.gray("".concat(duration, "ms"));
|
|
133
132
|
if (duration > 5000) {
|
|
134
133
|
dText = chalk_1.default.red("".concat(duration, "ms"));
|
|
@@ -136,7 +135,7 @@ function LogsHandler(ctx, next) {
|
|
|
136
135
|
else if (duration > 1000) {
|
|
137
136
|
dText = chalk_1.default.yellow("".concat(duration, "ms"));
|
|
138
137
|
}
|
|
139
|
-
console.log("
|
|
138
|
+
console.log("[".concat(chalk_1.default.magenta(method), " ").concat(dText, "] ").concat(ctx.url, " ").concat(statusColor(status_1)));
|
|
140
139
|
return [7 /*endfinally*/];
|
|
141
140
|
case 4: return [2 /*return*/];
|
|
142
141
|
}
|