本文整理匯總了TypeScript中@webkit/helper/logger.Logger類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Logger類的具體用法?TypeScript Logger怎麽用?TypeScript Logger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Logger類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Application
import { Application } from '@webkit/core/Application.class';
import { Logger, TLogLevel } from '@webkit/helper/logger';
let logger: Logger = Logger.getLogger('mainApp');
declare var window: any;
export var app: Application = new Application();
app.init({ logLevel: TLogLevel.TRACE });
app.ready((): void => {
logger.trace("ready !!!!");
logger.debug("ready !!!!");
logger.info("ready !!!!");
logger.warn("ready !!!!");
logger.error("ready !!!!");
logger.fatal("ready !!!!");
})
示例2: loadResource
export function loadResource(resource: string, callback: Function, context?: any): void {
if(logger.isTraceEnabled()) {
logger.trace("Chargement de la ressource %s".format(resource));
}
let callbackHandler = function (text: string, status: string) {
if (status == "success") {
if(logger.isDebugEnabled()) {
logger.debug("Chargement réussi de la ressource %s".format(resource));
}
if (callback) {
callback.call(context || this, text)
}
} else {
logger.error("Erreur lors du chargement de la ressource %s".format(resource));
}
}
if(!((resource || "").toLowerCase().startsWith('http'))) {
resource = app.servicesPath + resource;
}
Query.GET(resource, callback, context, { silent: true, upToDate: false });
}
示例3: function
let callbackHandler = function (text: string, status: string) {
if (status == "success") {
if(logger.isDebugEnabled()) {
logger.debug("Chargement réussi de la ressource %s".format(resource));
}
if (callback) {
callback.call(context || this, text)
}
} else {
logger.error("Erreur lors du chargement de la ressource %s".format(resource));
}
}
示例4:
app.ready((): void => {
logger.trace("ready !!!!");
logger.debug("ready !!!!");
logger.info("ready !!!!");
logger.warn("ready !!!!");
logger.error("ready !!!!");
logger.fatal("ready !!!!");
})