@@ -9,16 +9,20 @@ import {
99} from '../../src/constants.mjs' ;
1010import { publicGenerators } from '../../src/generators/index.mjs' ;
1111import createGenerator from '../../src/generators.mjs' ;
12+ import logger from '../../src/logger/index.mjs' ;
13+ import transports from '../../src/logger/transports.mjs' ;
1214import { parseChangelog , parseIndex } from '../../src/parsers/markdown.mjs' ;
1315import { loadAndParse } from '../utils.mjs' ;
1416
1517const availableGenerators = Object . keys ( publicGenerators ) ;
18+ const availableTransports = Object . keys ( transports ) ;
1619
1720/**
1821 * @typedef {Object } Options
1922 * @property {Array<string>|string } input - Specifies the glob/path for input files.
2023 * @property {Array<string>|string } [ignore] - Specifies the glob/path for ignoring files.
2124 * @property {Array<keyof publicGenerators> } target - Specifies the generator target mode.
25+ * @property {keyof availableTransports } transport - Specified the logging transport.
2226 * @property {string } version - Specifies the target Node.js version.
2327 * @property {string } changelog - Specifies the path to the Node.js CHANGELOG.md file.
2428 * @property {string } [gitRef] - Git ref/commit URL.
@@ -104,6 +108,15 @@ export default {
104108 } ) ) ,
105109 } ,
106110 } ,
111+ transport : {
112+ flags : [ '--transport [transport]' ] ,
113+ desc : 'Transport for logging' ,
114+ prompt : {
115+ type : 'multiselect' ,
116+ options : availableTransports . map ( t => ( { value : t , label : t } ) ) ,
117+ initialValue : 'pretty' ,
118+ } ,
119+ } ,
107120 index : {
108121 flags : [ '--index <path>' ] ,
109122 desc : 'The index document, for getting the titles of various API docs' ,
@@ -119,6 +132,8 @@ export default {
119132 * @returns {Promise<void> }
120133 */
121134 async action ( opts ) {
135+ logger . add ( transports [ opts . transport ] ( ) ) ;
136+
122137 const docs = await loadAndParse ( opts . input , opts . ignore ) ;
123138 const releases = await parseChangelog ( opts . changelog ) ;
124139 const index = opts . index && ( await parseIndex ( opts . index ) ) ;
0 commit comments