Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit ca8acbe

Browse files
committed
update enum values to PascalCase
1 parent 4df601b commit ca8acbe

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/logger/logger.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import TelemetryTransport from "./telemetry-transport";
77
import UserNotificationTransport from "./user-notification-transport";
88

99
export enum LogLevel {
10-
info = "info",
11-
warn = "warn",
12-
error = "error",
10+
Info = "info",
11+
Warn = "warn",
12+
Error = "error",
1313
}
1414

1515
function FilterErrorPath(line: string): string {
@@ -27,9 +27,9 @@ function FilterErrorPath(line: string): string {
2727
export function configure(context: vscode.ExtensionContext) {
2828
winston.configure({
2929
transports: [
30-
new (winston.transports.File)({ level: LogLevel.warn, filename: context.asAbsolutePath("arduino.log") }),
31-
new TelemetryTransport({ level: LogLevel.info, context }),
32-
new UserNotificationTransport({ level: LogLevel.info }),
30+
new (winston.transports.File)({ level: LogLevel.Warn, filename: context.asAbsolutePath("arduino.log") }),
31+
new TelemetryTransport({ level: LogLevel.Info, context }),
32+
new UserNotificationTransport({ level: LogLevel.Info }),
3333
],
3434
});
3535
}
@@ -60,7 +60,7 @@ export function silly(message: string, metadata?: any) {
6060

6161
export function traceUserData(message: string, metadata?: any) {
6262
// use `info` as the log level and add a special flag in metadata
63-
winston.log(LogLevel.info, message, { ...metadata, telemetry: true });
63+
winston.log(LogLevel.Info, message, { ...metadata, telemetry: true });
6464
}
6565

6666
function traceErrorOrWarning(level: string, message: string, error: Error, metadata?: any) {
@@ -78,11 +78,11 @@ function traceErrorOrWarning(level: string, message: string, error: Error, metad
7878
}
7979

8080
export function traceError(message: string, error: Error, metadata?: any) {
81-
traceErrorOrWarning(LogLevel.error, message, error, metadata);
81+
traceErrorOrWarning(LogLevel.Error, message, error, metadata);
8282
}
8383

8484
export function traceWarning(message: string, error: Error, metadata?: any) {
85-
traceErrorOrWarning(LogLevel.warn, message, error, metadata);
85+
traceErrorOrWarning(LogLevel.Warn, message, error, metadata);
8686
}
8787

8888
export function notifyAndThrowUserError(errorCode: string, error: Error, message?: string) {

src/logger/telemetry-transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class TelemetryTransport extends winston.Transport {
6161
}
6262
}
6363
}
64-
if (level === LogLevel.info) {
64+
if (level === LogLevel.Info) {
6565
this.reporter.sendTelemetryEvent(message, properties, measures);
6666
} else {
6767
this.reporter.sendTelemetryErrorEvent(message, properties, measures, ["message", "notification", "errorLine"]);

src/logger/user-notification-transport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export default class UserNotificationTransport extends winston.Transport {
1414
protected log(level: string, message: string, metadata?: any, callback?: (arg1, arg2) => void) {
1515
if (metadata && metadata.showUser) {
1616
const notification = (metadata && metadata.notification) ? metadata.notification : message;
17-
if (level === LogLevel.warn) {
17+
if (level === LogLevel.Warn) {
1818
vscode.window.showWarningMessage(notification);
19-
} else if (level === LogLevel.error) {
19+
} else if (level === LogLevel.Error) {
2020
vscode.window.showErrorMessage(notification);
2121
} else {
2222
winston.error(`Invalid error level '${level}' for user notification.`);

0 commit comments

Comments
 (0)