1
>
/*---------------------------------------------------------------------------------------------
severity.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import * as strings from './strings.js';
7
>
8
>
enum Severity {
9
>
Ignore = 0,
10
>
Info = 1,
11
>
Warning = 2,
12
>
Error = 3
13
>
}
14
>
15
>
namespace Severity {
16
>
17
>
const _error = 'error';
18
>
const _warning = 'warning';
19
>
const _warn = 'warn';
20
>
const _info = 'info';
21
>
const _ignore = 'ignore';
22
>
23
>
/**
24
>
* Parses 'error', 'warning', 'warn', 'info' in call casings
25
>
* and falls back to ignore.
26
>
*/
27
>
export function fromValue(value: string): Severity {
28
if (!value) {
29
return Severity.Ignore;