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


TypeScript mainLogger.child方法代码示例

本文整理汇总了TypeScript中main/logger.mainLogger.child方法的典型用法代码示例。如果您正苦于以下问题:TypeScript mainLogger.child方法的具体用法?TypeScript mainLogger.child怎么用?TypeScript mainLogger.child使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在main/logger.mainLogger的用法示例。


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

示例1: function

import { actions } from "common/actions";
import urls from "common/constants/urls";
import { Store } from "common/types";
import { isItchioURL } from "common/util/url";
import { Watcher } from "common/util/watcher";
import { shell } from "electron";
import { mainLogger } from "main/logger";
import { modals } from "common/modals";
import urlParser from "url";
import querystring from "querystring";
import { doAsync } from "renderer/helpers/doAsync";
import { queueInstall } from "main/reactors/tasks/queue-game";
import { mcall } from "main/butlerd/mcall";
import { messages } from "common/butlerd";

const logger = mainLogger.child(__filename);

export default function(watcher: Watcher) {
  watcher.on(actions.processUrlArguments, async (store, action) => {
    const { args } = action.payload;
    for (const uri of args) {
      if (isItchioURL(uri)) {
        store.dispatch(actions.handleItchioURI({ uri }));
        break;
      }
    }
  });

  watcher.on(actions.openInExternalBrowser, async (store, action) => {
    const uri = action.payload.url;
    shell.openExternal(uri);
开发者ID:itchio,项目名称:itch,代码行数:31,代码来源:url.ts

示例2:

import childProcess from "child_process";
import { formatExitCode } from "common/format/exit-code";
import { Logger } from "common/logger";
import { ItchPromise } from "common/util/itch-promise";
import { mainLogger } from "main/logger";
import split2 from "split2";
import stream from "stream";
import { MinimalContext } from "main/context";

const spawnLogger = mainLogger.child(__filename);

interface SpawnOpts {
  /** Context this should run in */
  ctx: MinimalContext;

  /** Command to spawn */
  command: string;

  /** Arguments */
  args: string[];

  /** Defaults to eol for the current platform ("\r\n" or "\n") */
  split?: string;

  /** Called when the process has been started and we're ready to write to stdin */
  onStdinReady?: (stdin: stream.Writable) => void;

  /** If set, called on each line of stdout */
  onToken?: (token: string) => void;

  /** If set, called on each line of stderr */
开发者ID:itchio,项目名称:itch,代码行数:31,代码来源:spawn.ts


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