當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript LogFactory.getLogger方法代碼示例

本文整理匯總了TypeScript中@wireapp/commons.LogFactory.getLogger方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LogFactory.getLogger方法的具體用法?TypeScript LogFactory.getLogger怎麽用?TypeScript LogFactory.getLogger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@wireapp/commons.LogFactory的用法示例。


在下文中一共展示了LogFactory.getLogger方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getLogger

function getLogger(name: string): logdown.Logger {
  const options: LoggerOptions = {
    namespace: LOGGER_NAMESPACE,
    separator: '/',
  };

  if (ENABLE_LOGGING) {
    options.forceEnable = true;
  }

  return LogFactory.getLogger(name, options);
}
開發者ID:wireapp,項目名稱:wire-desktop,代碼行數:12,代碼來源:getLogger.ts

示例2: CustomProtocolHandler

// Paths
const APP_PATH = app.getAppPath();
const INDEX_HTML = path.join(APP_PATH, 'renderer/index.html');
const LOG_DIR = path.join(app.getPath('userData'), 'logs');
const LOG_FILE = path.join(LOG_DIR, 'electron.log');
const PRELOAD_JS = path.join(APP_PATH, 'dist/renderer/preload.js');
const PRELOAD_RENDERER_JS = path.join(APP_PATH, 'renderer/static/webview-preload.js');
const WRAPPER_CSS = path.join(APP_PATH, 'css/wrapper.css');
const WINDOW_SIZE = {
  DEFAULT_HEIGHT: 768,
  DEFAULT_WIDTH: 1024,
  MIN_HEIGHT: 512,
  MIN_WIDTH: 760,
};

const logger = LogFactory.getLogger(__filename, {forceEnable: true, logFilePath: LOG_FILE});
const customProtocolHandler = new CustomProtocolHandler();

// Config
const argv = minimist(process.argv.slice(1));
const BASE_URL = EnvironmentUtil.web.getWebappUrl(argv.env);

// Icon
const ICON = `wire.${EnvironmentUtil.platform.IS_WINDOWS ? 'ico' : 'png'}`;
const ICON_PATH = path.join(APP_PATH, 'img', ICON);
let tray: TrayHandler;

let isFullScreen = false;
let isQuitting = false;
let main: BrowserWindow;
開發者ID:wireapp,項目名稱:wire-desktop,代碼行數:30,代碼來源:main.ts

示例3: constructor

 constructor() {
   this.logger = LogFactory.getLogger('ElectronWrapperInit', {logFilePath: path.join(LOG_DIR, 'electron.log')});
 }
開發者ID:wireapp,項目名稱:wire-desktop,代碼行數:3,代碼來源:main.ts

示例4: Promise

 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

import {LogFactory, ValidationUtil} from '@wireapp/commons';
import {app, webContents} from 'electron';
import * as fs from 'fs-extra';
import * as path from 'path';

const USER_DATA_DIR = app.getPath('userData');
const LOG_DIR = path.join(USER_DATA_DIR, 'logs');

const logger = LogFactory.getLogger(__filename, {logFilePath: path.join(LOG_DIR, 'electron.log')});

const clearStorage = (session: Electron.Session) => {
  return new Promise(resolve =>
    session.clearStorageData({}, () =>
      session.clearCache(() => {
        session.flushStorageData();
        resolve();
      })
    )
  );
};

export async function deleteAccount(id: number, accountId: string, partitionId?: string) {
  // Delete session data
  try {
開發者ID:wireapp,項目名稱:wire-desktop,代碼行數:31,代碼來源:LocalAccountDeletion.ts


注:本文中的@wireapp/commons.LogFactory.getLogger方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。