Skip to content

Commit e0d3aff

Browse files
committed
fix: Duration string is not printed for all messages -- Load Request SQL case
1 parent 323ce5b commit e0d3aff

File tree

1 file changed

+4
-3
lines changed
  • packages/cubejs-server-core/core

1 file changed

+4
-3
lines changed

packages/cubejs-server-core/core/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const devLogger = (level) => (type, { error, warning, ...message }) => {
6565
if (queryKey && queryKey[0] && Array.isArray(queryKey[0]) && typeof queryKey[0][0] === 'string') {
6666
[queryKey] = queryKey;
6767
}
68+
const durationStr = duration ? `(${duration}ms)` : '';
6869
if (queryKey && typeof queryKey[0] === 'string') {
6970
const queryMaxLines = 50;
7071
let formatted = SqlString.format(queryKey[0], queryKey[1]).split('\n');
@@ -73,12 +74,12 @@ const devLogger = (level) => (type, { error, warning, ...message }) => {
7374
.concat(['.....', '.....', '.....'])
7475
.concat(R.takeLast(queryMaxLines / 2, formatted));
7576
}
76-
return `${duration ? `(${duration}ms)` : ''}\n${formatted.join('\n')}\n${restParams}`;
77+
return `${durationStr}\n${formatted.join('\n')}\n${restParams}`;
7778
}
7879
if (queryKey) {
79-
return `${duration ? `(${duration}ms)` : ''}\n${JSON.stringify(queryKey)}\n${restParams}`; // TODO format
80+
return `${durationStr}\n${JSON.stringify(queryKey)}\n${restParams}`; // TODO format
8081
}
81-
return restParams;
82+
return `${durationStr}\n${restParams}`;
8283
};
8384

8485
const logWarning = () => console.log(

0 commit comments

Comments
 (0)