Skip to content

Commit daf1b19

Browse files
committed
fix(logging): only show payload size if payload exists
1 parent fab1e29 commit daf1b19

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export async function request<DataType = unknown, ErrorType = string>(
4444
): Promise<RequestResponse<DataType, ErrorType>> {
4545
log.info(
4646
'api-calls',
47-
`[🐛 ${method}] ${endpoint} - Size ${formatBytes(JSON.stringify(body).length)}.`,
47+
`[🐛 ${method}] ${endpoint} - ${
48+
body ? `Size: ${formatBytes(JSON.stringify(body).length)}` : ''
49+
}.`,
4850
{ payload: body }
4951
)
5052
try {

0 commit comments

Comments
 (0)