Improve logs for embed
This commit is contained in:
@@ -97,6 +97,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
|
|||||||
const _q = q
|
const _q = q
|
||||||
const embed = async (name, q = {}) => {
|
const embed = async (name, q = {}) => {
|
||||||
//Check arguments
|
//Check arguments
|
||||||
|
console.debug(`metrics/compute/${login}/embed > ${name} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`)
|
||||||
if ((!name) || (typeof q !== "object") || (q === null)) {
|
if ((!name) || (typeof q !== "object") || (q === null)) {
|
||||||
if (die)
|
if (die)
|
||||||
throw new Error("An error occured during embed rendering, dying")
|
throw new Error("An error occured during embed rendering, dying")
|
||||||
@@ -123,6 +124,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
|
|||||||
console.debug(q)
|
console.debug(q)
|
||||||
//Compute rendering
|
//Compute rendering
|
||||||
const {rendered} = await metrics({login, q}, {...arguments[1], convert:["svg", "png", "jpeg"].includes(q["config.output"]) ? q["config.output"] : null}, arguments[2])
|
const {rendered} = await metrics({login, q}, {...arguments[1], convert:["svg", "png", "jpeg"].includes(q["config.output"]) ? q["config.output"] : null}, arguments[2])
|
||||||
|
console.debug(`metrics/compute/${login}/embed > ${name} > success >>>>>>>>>>>>>>>>>>>>>>`)
|
||||||
return `<img class="metrics-cachable" data-name="${name}" src="data:image/${{png:"png", jpeg:"jpeg"}[q["config.output"]] ?? "svg+xml"};base64,${Buffer.from(rendered).toString("base64")}">`
|
return `<img class="metrics-cachable" data-name="${name}" src="data:image/${{png:"png", jpeg:"jpeg"}[q["config.output"]] ?? "svg+xml"};base64,${Buffer.from(rendered).toString("base64")}">`
|
||||||
}
|
}
|
||||||
//Rendering template source
|
//Rendering template source
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default async function({login, graphql, data, q, queries, imports}, conf)
|
|||||||
}
|
}
|
||||||
//Success
|
//Success
|
||||||
console.debug(`metrics/compute/${login}/base > graphql query > account ${account} > success`)
|
console.debug(`metrics/compute/${login}/base > graphql query > account ${account} > success`)
|
||||||
console.debug(data)
|
console.debug(data.user)
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user