本文整理匯總了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);
}
示例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;
示例3: constructor
constructor() {
this.logger = LogFactory.getLogger('ElectronWrapperInit', {logFilePath: path.join(LOG_DIR, 'electron.log')});
}
示例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 {