@swell/cli 2.9.34 → 2.9.35
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/lib/logs/index.js +12 -5
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/lib/logs/index.js
CHANGED
|
@@ -52,10 +52,9 @@ export class LoggedItem {
|
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
case 'api': {
|
|
55
|
-
request = [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
].join(' ');
|
|
55
|
+
request = [methodLabel(logMessage.method), logMessage.url]
|
|
56
|
+
.filter(Boolean)
|
|
57
|
+
.join(' ');
|
|
59
58
|
break;
|
|
60
59
|
}
|
|
61
60
|
default: {
|
|
@@ -87,7 +86,7 @@ export class LoggedItem {
|
|
|
87
86
|
const { event } = logMessage;
|
|
88
87
|
const { logs, method, name } = logMessage;
|
|
89
88
|
const logLines = this.prepareConsoleLines(logs);
|
|
90
|
-
return `Function ${event ? `${event.hook ? `${event.hook}:` : ''}${event.type} >` : ''} ${
|
|
89
|
+
return `Function ${event ? `${event.hook ? `${event.hook}:` : ''}${event.type} >` : ''} ${methodLabel(method)} /${name} ${logLines ? `\n${logLines}` : ''}`;
|
|
91
90
|
}
|
|
92
91
|
prepareConsoleLines(logs) {
|
|
93
92
|
return logs
|
|
@@ -111,3 +110,11 @@ export class LoggedItem {
|
|
|
111
110
|
.join('\n');
|
|
112
111
|
}
|
|
113
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* A request method for display; some entries, such as hook rejections, have none.
|
|
115
|
+
* @param {unknown} method the logged method
|
|
116
|
+
* @returns {string} the styled method, or an empty string
|
|
117
|
+
*/
|
|
118
|
+
function methodLabel(method) {
|
|
119
|
+
return method ? style.logMethod(String(method).toUpperCase()) : '';
|
|
120
|
+
}
|
package/oclif.manifest.json
CHANGED