This commit is contained in:
dcodeIO
2017-11-17 14:33:51 +01:00
parent d1c1178f25
commit d3d4938b68
17 changed files with 580 additions and 303 deletions

View File

@ -11,10 +11,12 @@ export enum DiagnosticCategory {
}
export function diagnosticCategoryToString(category: DiagnosticCategory): string {
if (category == DiagnosticCategory.INFO) return "INFO";
if (category == DiagnosticCategory.WARNING) return "WARNING";
if (category == DiagnosticCategory.ERROR) return "ERROR";
return "";
switch (category) {
case DiagnosticCategory.INFO: return "INFO";
case DiagnosticCategory.WARNING: return "WARNING";
case DiagnosticCategory.ERROR: return "ERROR";
default: return "";
}
}
const colorBlue: string = "\u001b[93m";
@ -23,10 +25,12 @@ const colorRed: string = "\u001b[91m";
const colorReset: string = "\u001b[0m";
export function diagnosticCategoryToColor(category: DiagnosticCategory): string {
if (category == DiagnosticCategory.INFO) return colorBlue;
if (category == DiagnosticCategory.WARNING) return colorYellow;
if (category == DiagnosticCategory.ERROR) return colorRed;
return "";
switch (category) {
case DiagnosticCategory.INFO: return colorBlue;
case DiagnosticCategory.WARNING: return colorYellow;
case DiagnosticCategory.ERROR: return colorRed;
default: return "";
}
}
export class DiagnosticMessage {