UNPKG

@xmobitea/gn-typescript-client

Version:

GearN Typescript Client SDK by XmobiTea (Pro)

30 lines (29 loc) 873 B
export var LogType; (function (LogType) { LogType[LogType["Off"] = 0] = "Off"; LogType[LogType["Exception"] = 1] = "Exception"; LogType[LogType["Error"] = 2] = "Error"; LogType[LogType["Warning"] = 3] = "Warning"; LogType[LogType["All"] = 4] = "All"; })(LogType || (LogType = {})); export class GNDebug { static setLogType(logType) { this._logType = logType; } static log(message) { if (this._logType >= LogType.All) console.log(message); } static logException(exception) { if (this._logType >= LogType.Exception) console.error(exception); } static logWarning(message) { if (this._logType >= LogType.Warning) console.warn(message); } static logError(message) { if (this._logType >= LogType.Error) console.error(message); } }