本文整理匯總了TypeScript中@akala/server.logger類的典型用法代碼示例。如果您正苦於以下問題:TypeScript logger類的具體用法?TypeScript logger怎麽用?TypeScript logger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了logger類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: reject
return new Promise<any>((resolve, reject) =>
{
if (!kodi.isConnected())
{
client.$proxy().unregisterPlayer({ identity: kodiService.id, name: kodiService.name })
reject(new Error('Not connected'));
return;
}
akala.each(m.params, function (value)
{
if (value.required && typeof (params[value.name]) == 'undefined')
{
throw JSON.stringify(params) + ' is missing the required param ' + value.name + ' for ' + ns[1];
}
});
akala.logger.verbose('calling ' + i, JSON.stringify(params));
kodi.send(i as string, params, (error, result) =>
{
if (error)
reject(error);
else
resolve(result);
});
});
示例2: async
trigger: async (param) =>
{
var triggerData = akala.extend({ $date: new Date() }, param.data);
var conditionsData: PayloadDataType = null;
akala.logger.verbose(`trigger ${param.id} received`);
if (triggerMap[param.id].condition)
{
var result = interpolate(triggerMap[param.id].condition.params, triggerData);
conditionsData = await server.executeCondition({ name: triggerMap[param.id].condition.name, channel: triggerMap[param.id].condition.channel, params: { $triggerData: triggerData, ...result } });
}
akala.logger.verbose(`interpolating: ${JSON.stringify(triggerMap[param.id].action.params)}`);
akala.logger.verbose(`triggerData: ${JSON.stringify(triggerData)}`);
akala.logger.verbose(`conditionsData: ${JSON.stringify(conditionsData)}`);
await server.executeAction({ name: triggerMap[param.id].action.name, channel: triggerMap[param.id].action.channel, params: interpolate(triggerMap[param.id].action.params, { $triggerData: triggerData, $conditionsData: conditionsData }) });
},
示例3: function
kodi[ns[0]][ns[1]] = function (callback)
{
if (typeof (callback) == 'undefined')
{
throw 'callback is missing for ' + ns[1];
}
akala.logger.info('monitoring ' + i, JSON.stringify(i));
kodi.expose(i, callback);
}
示例4: function
</episodedetails>`, 'utf8', function (err)
{
if (err)
akala.logger.error(err);
});