@antora/assembler
Version:
A JavaScript library that merges AsciiDoc content from multiple pages in an Antora site into assembly files and delegates to an exporter to convert those files to another format, such as PDF.
19 lines (16 loc) • 855 B
JavaScript
function logCommand (loggerName, command, file, convertAttributes, attributeOptionFlagOrArgs) {
const logger = this?.getLogger(loggerName)
if (!logger?.isLevelEnabled('debug')) return
const { docfile, 'assembler-filetype': filetype } = convertAttributes
const args = Array.isArray(attributeOptionFlagOrArgs)
? attributeOptionFlagOrArgs
: attributeOptionFlagOrArgs
? convertAttributes.toArgs(attributeOptionFlagOrArgs, command)
: []
const ctx = { command: [command].concat(args).join(' '), file: { path: docfile } }
const msg = `Running external command to export assembly in %s to %s: %s`
const componentVersionStr = file.src.version ? `${file.src.version}@${file.src.component}` : file.src.component
logger.debug(ctx, msg, componentVersionStr, filetype, file.src.relative)
}
module.exports = logCommand