diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts new file mode 100644 index 000000000..0c51c867b --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts @@ -0,0 +1,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 + } + } +} |