Skip to content

Commit ed4f58c

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent a33b4b5 commit ed4f58c

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

packages/logger/src/logger.ts

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ export function setUserLogHandler(
214214
options: LogOptions
215215
): void {
216216
if (logCallback !== null && typeof logCallback !== 'function') {
217-
throw new TypeError('First argument to `onLog` must be null or a function.');
217+
throw new TypeError(
218+
'First argument to `onLog` must be null or a function.'
219+
);
218220
}
219221
for (const instance of instances) {
220222
let threshhold = instance.logLevel;
@@ -229,25 +231,26 @@ export function setUserLogHandler(
229231
level: LogLevel,
230232
...args: unknown[]
231233
) => {
232-
const message = args.map(arg => {
233-
if (arg == null) {
234-
return null;
235-
} else if (typeof arg === 'string') {
236-
return arg;
237-
} else if (typeof arg === 'number' || typeof arg === 'boolean') {
238-
return arg.toString();
239-
} else if (arg instanceof Error) {
240-
return arg.message;
241-
} else {
242-
try {
243-
return JSON.stringify(arg);
244-
} catch(ignored) {
234+
const message = args
235+
.map(arg => {
236+
if (arg == null) {
245237
return null;
238+
} else if (typeof arg === 'string') {
239+
return arg;
240+
} else if (typeof arg === 'number' || typeof arg === 'boolean') {
241+
return arg.toString();
242+
} else if (arg instanceof Error) {
243+
return arg.message;
244+
} else {
245+
try {
246+
return JSON.stringify(arg);
247+
} catch (ignored) {
248+
return null;
249+
}
246250
}
247-
}
248-
})
249-
.filter(arg => arg)
250-
.join(' ');
251+
})
252+
.filter(arg => arg)
253+
.join(' ');
251254
if (level >= threshhold) {
252255
logCallback({
253256
level: LogLevel[level].toLowerCase() as LogLevelString,

0 commit comments

Comments
 (0)