summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts
blob: 0c51c867b068fde19cb46e7073ebc88a65214cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'logPriority'
})
export class LogPriorityPipe implements PipeTransform {
  transform(value: any): any {
    if (value === '[DBG]') {
      return 'debug';
    } else if (value === '[INF]') {
      return 'info';
    } else if (value === '[WRN]') {
      return 'warn';
    } else if (value === '[ERR]') {
      return 'err';
    } else {
      return ''; // Inherit
    }
  }
}