UNPKG

@freemework/common

Version:

Common library of the Freemework Project.

55 lines 1.95 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FLoggerLevel = void 0; const f_exception_argument_js_1 = require("../exception/f_exception_argument.js"); const _trace = "TRACE"; const _debug = "DEBUG"; const _info = "INFO"; const _warn = "WARN"; const _error = "ERROR"; const _fatal = "FATAL"; class FLoggerLevel extends Object { _textValue; _intValue; static TRACE = new FLoggerLevel(_trace, 6); static DEBUG = new FLoggerLevel(_debug, 5); static INFO = new FLoggerLevel(_info, 4); static WARN = new FLoggerLevel(_warn, 3); static ERROR = new FLoggerLevel(_error, 2); static FATAL = new FLoggerLevel(_fatal, 1); static parse(value) { switch (value) { case _trace: return FLoggerLevel.TRACE; case _debug: return FLoggerLevel.DEBUG; case _info: return FLoggerLevel.INFO; case _warn: return FLoggerLevel.WARN; case _error: return FLoggerLevel.ERROR; case _fatal: return FLoggerLevel.FATAL; default: throw new f_exception_argument_js_1.FExceptionArgument(`Cannot parse '${value}' as '${FLoggerLevel.name}'`); } } valueOf() { return this._intValue; } // bool operator > (FLoggerLevel other) => this._intValue > other._intValue; // bool operator >= (FLoggerLevel other) => this._intValue >= other._intValue; // bool operator < (FLoggerLevel other) => this._intValue < other._intValue; // bool operator <= (FLoggerLevel other) => this._intValue <= other._intValue; toString() { return this._textValue; } constructor(_textValue, _intValue) { super(); this._textValue = _textValue; this._intValue = _intValue; } } exports.FLoggerLevel = FLoggerLevel; //# sourceMappingURL=f_logger_level.js.map