当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript chalk.bgRed类代码示例

本文整理汇总了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;
  }
开发者ID:gitter-badger,项目名称:ubiquits,代码行数:27,代码来源:consoleLogger.service.ts

示例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));
    }
}
开发者ID:node-opcua,项目名称:node-opcua,代码行数:13,代码来源:make_loggers.ts

示例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);
        });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:20,代码来源:server_secure_channel_layer.ts

示例4:

 .catch((error) => {
     console.error(chalk.bgRed.white(`Crush ${error}`));
 });
开发者ID:cm0s,项目名称:mea2n,代码行数:3,代码来源:server.ts


注:本文中的chalk.bgRed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。