本文整理匯總了TypeScript中lib/loggers.verbose函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript verbose函數的具體用法?TypeScript verbose怎麽用?TypeScript verbose使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了verbose函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: verbose
.then(({ body, headers }) => {
verbose(`Refreshing: ${key}`)
if (apiOptions.headers) {
return cache.set(key, { body, headers })
} else {
return cache.set(key, body)
}
})
示例2: resolve
.then(({ body, headers }) => {
if (apiOptions.headers) {
resolve({ body, headers })
} else {
resolve(body)
}
verbose(`Requested (Uncached): ${key}`)
const time = clock.end()
logger(
globalAPIOptions.requestIDs.requestID,
apiName,
key,
{ time, cache: false }
)
})
示例3: Promise
return new Promise((resolve, reject) => {
verbose(`Requested: ${key}`)
api(key, accessToken, apiOptions)
.then(response => {
if (apiOptions.headers) {
resolve(pick(response, ["body", "headers"]))
} else {
resolve(response.body)
}
const time = clock.end()
return logger(
globalAPIOptions.requestIDs.requestID,
apiName,
key,
{ time, cache: false }
)
})
.catch(err => {
warn(path, err)
reject(err)
})
})