本文整理汇总了TypeScript中chalk.bgRed类的典型用法代码示例。如果您正苦于以下问题:TypeScript bgRed类的具体用法?TypeScript bgRed怎么用?TypeScript bgRed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了bgRed类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: format
public format(logLevel: LogLevel, message: string) {
switch (logLevel) {
case 'emergency':
message = bgRed.underline(message);
break;
case 'alert':
message = red.underline(message);
break;
case 'critical':
message = bgYellow(message);
break;
case 'warning':
message = yellow(message);
break;
case 'notice':
message = magenta(message);
break;
case 'info':
message = blue(message);
break;
case 'debug':
message = gray(message);
break;
}
return message;
}
示例2: file_line
/**
* file_line return a 51 caracter string
* @param filename
* @param callerLine
*/
function file_line(mode: "E" | "D", filename: string, callerLine: number): string {
const d = (new Date()).toISOString().substr(11);
if (mode === "D") {
return chalk.bgWhite.cyan(w(d, 14) + ":" + w(filename, 30) + ":" + w(callerLine.toString(), 5));
} else {
return chalk.bgRed.white(w(d, 14) + ":" + w(filename, 30) + ":" + w(callerLine.toString(), 5));
}
}
示例3: assert
this._process_certificates(message, (err: Error | null, statusCode?: StatusCode) => {
if (err) {
description = "Internal Error " + err.message;
return this._send_error(StatusCodes.BadInternalError, description, message, callback);
}
if (!statusCode) {
assert(false);
}
if (statusCode !== StatusCodes.Good) {
const description = "Sender Certificate Error";
console.log(chalk.cyan(description), chalk.bgRed.yellow(statusCode!.toString()));
// OPCUA specification v1.02 part 6 page 42 $6.7.4
// If an error occurs after the Server has verified Message security it shall return a ServiceFault instead
// of a OpenSecureChannel response. The ServiceFault Message is described in Part 4, 7.28.
return this._send_error(statusCode!, "", message, callback);
}
this._handle_OpenSecureChannelRequest(message, callback);
});
示例4:
.catch((error) => {
console.error(chalk.bgRed.white(`Crush ${error}`));
});