• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript loglevel.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中loglevel.info函数的典型用法代码示例。如果您正苦于以下问题:TypeScript info函数的具体用法?TypeScript info怎么用?TypeScript info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了info函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: if

        .map(res => {
          const user = res[0];
          const askForAuths = res[1];
          const latestVersion = res[2];

          // is approval required for this authenticator
          const approvalRequired = askForAuths.indexOf(user.auth) !== -1;
          // has user already approved the terms of use
          const approved =
            user.termsVersion >= latestVersion && user.termsAccepted != null;

          if (!approvalRequired) {
            return true;
          } else if (approved) {
            log.info("terms of use accepted already");
            return true;
          } else {
            log.info(
              "terms of use must be accepted first",
              ", required for this auth:",
              approvalRequired,
              ", accpeted version:",
              user.termVersion,
              ", latest version:",
              latestVersion,
              ", accepted timestamp:",
              user.termsAccepted
            );
            this.routeService.navigateAbsolute("/terms");
            return false;
          }
        })
开发者ID:chipster,项目名称:chipster-web,代码行数:32,代码来源:auth-guard.service.ts


示例2:

 .flatMap(session => {
   log.info("session copied, current state", session.state, temporary);
   if (temporary) {
     session.state = SessionState.TemporaryUnmodified;
   } else {
     session.state = SessionState.Ready;
   }
   log.info("set to", session.state);
   return this.updateSession(session);
 })
开发者ID:chipster,项目名称:chipster-web,代码行数:10,代码来源:session.resource.ts


示例3:

 path => {
   if (path) {
     this.homeFile = this.routeService.basename(path);
     this.homePath = this.routeService.dirname(path) + "/";
     log.info("loading custom home page", this.homePath, this.homeFile);
   }
 },
开发者ID:chipster,项目名称:chipster-web,代码行数:7,代码来源:home.component.ts


示例4: onBuild

// error handling taken from https://webpack.github.io/docs/node.js-api.html#error-handling
function onBuild(
  resolve: any,
  reject: any,
  err: any,
  stats: compiler.Stats,
  watcher?: any
) {
  if (err) {
    // "hard" error
    return reject(err);
  }

  if (stats.hasErrors()) {
    // "soft" error
    return reject(stringifyStats(stats));
  }

  if (stats.hasWarnings()) {
    warn(stringifyStats(stats));
  }

  if (isVerbose()) {
    info(stringifyStats(stats));
  }

  // note: watcher is optional
  resolve(watcher);
}
开发者ID:otbe,项目名称:ws,代码行数:29,代码来源:compiler.ts


示例5: watch

export default async function watch() {
  await removeAsync(project.ws.distDir);

  const port = await findAsync({
    startingPort: 35729
  });
  const livereloadServer = livereload.createServer({ port });
  const onChangeSuccess = (stats) => info(`Finished build at ${cyan(moment(stats.endTime).format('HH:mm:ss'))}.`);
  switch (project.ws.type) {
    case TYPE.NODE:
      await watchAsync(livereloadServer, nodeOptions, onChangeSuccess);
      break;
    case TYPE.SPA:
      if (project.ws.i18n) {
        await watchAsync(livereloadServer, createLocaleSpecificOptions(spaOptions, project.ws.i18n.locales[0]), onChangeSuccess);
      } else {
        await watchAsync(livereloadServer, spaOptions, onChangeSuccess);
      }
      break;
    case TYPE.BROWSER:
      if (project.ws.i18n) {
        await watchAsync(livereloadServer, createLocaleSpecificOptions(browserOptions, project.ws.i18n.locales[0]), onChangeSuccess);
      } else {
        await watchAsync(livereloadServer, browserOptions, onChangeSuccess);
      }
      break;
  }

  info('Finished initial build.');

  const middlewares = [
    livereloadMiddleware()
  ];
  await listenAsync(middlewares);
};
开发者ID:Mercateo,项目名称:typedocs,代码行数:35,代码来源:watch.ts


示例6:

 (latestSession: LatestSession) => {
   // valid id from store?
   const idFromStore = latestSession.sessionId;
   if (
     idFromStore &&
     sessions.some(session => session.sessionId === idFromStore)
   ) {
     log.info("found valid latest session id from store", idFromStore);
     return Observable.of(idFromStore);
   } else {
     // valid source session id from store?
     const sourceSessionIdFromStore = latestSession.sourceSessionId;
     if (
       sourceSessionIdFromStore &&
       sessions.some(
         session => session.sessionId === sourceSessionIdFromStore
       )
     ) {
       log.info(
         "found valid source session id from store",
         sourceSessionIdFromStore
       );
       return Observable.of(sourceSessionIdFromStore);
     } else {
       // valid id from session db?
       return this.getLatestSessionFromSessionDb().mergeMap(
         (idFromSessionDb: string) => {
           if (
             idFromSessionDb !== null &&
             sessions.some(
               session => session.sessionId === idFromSessionDb
             )
           ) {
             log.info(
               "found valid latest session id from sessionDb",
               idFromSessionDb
             );
             return Observable.of(idFromSessionDb);
           } else {
             log.info("no valid latest session id in sessionDb");
             return Observable.of(null);
           }
         }
       );
     }
   }
 }
开发者ID:chipster,项目名称:chipster-web,代码行数:47,代码来源:user.service.ts


示例7:

 () => {
   log.info("websocket closed");
   // if not unsubscribed
   if (this.topic) {
     // reconnect after clean close (server idle timeout)
     this.connect(listener, topic);
   }
 }
开发者ID:chipster,项目名称:chipster-web,代码行数:8,代码来源:websocket.service.ts


示例8: return

 return (options) => {
   // handle global options
   setLevel(levels[options.parent.logLevel.toUpperCase()]);
   // handle specific action
   info(`run ${cyan(options.name())}...`);
   return action(options)
     .then(() => info(`finished ${cyan(options.name())} ♥`))
     .catch(handleError);
 };
开发者ID:Mercateo,项目名称:typedocs,代码行数:9,代码来源:index.ts


示例9: build

export default async function build(options) {
  switch (project.ws.type) {
    case TYPE.NODE:
      await removeAsync(project.ws.distDir);
      await compileAsync(nodeOptions);
      break;
    case TYPE.SPA:
      if (options.production) {
        await removeAsync(project.ws.distReleaseDir);
        if (project.ws.i18n) {
          for (const locale of project.ws.i18n.locales) {
            info(`...for locale ${locale}.`);
            await compileAsync(createLocaleSpecificOptions(spaReleaseOptions, locale));
          }
        } else {
          await compileAsync(spaReleaseOptions);
        }
      } else {
        await removeAsync(project.ws.distDir);
        if (project.ws.i18n) {
          await compileAsync(createLocaleSpecificOptions(spaOptions, project.ws.i18n.locales[0]));
        } else {
          await compileAsync(spaOptions);
        }
      }
      break;
    case TYPE.BROWSER:
      await removeAsync(project.ws.distDir);
      if (project.ws.i18n) {
        for (const locale of project.ws.i18n.locales) {
          info(`...for locale ${locale}.`);
          await compileAsync(createLocaleSpecificOptions(browserOptions, locale));
          await compileAsync(createLocaleSpecificOptions(browserReleaseOptions, locale));
        }
        info(`...with all locales.`);
      }
      // even when we use locales, we create a default build containing *all* translations
      // users can select a locale with `window.process = { env: { LOCALE: 'en_GB' } };`, before they load
      // our component (this is mostly for users without build tools)
      await compileAsync(browserOptions);
      await compileAsync(browserReleaseOptions);
      break;
  }
};
开发者ID:Mercateo,项目名称:typedocs,代码行数:44,代码来源:build.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript loglevel.setDefaultLevel函数代码示例发布时间:2022-05-25
下一篇:
TypeScript loglevel.getLogger函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap