diff --git a/src/index.ts b/src/index.ts index 2b705804..9f8c03d4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -180,9 +180,8 @@ export default async (options: SvgToFontOptions = {}) => { options.website.version = pkg.version; } } - - log.disabled = options.log || false; - console.log('options.logger::', options.logger) + if (options.log === undefined) options.log = true; + log.disabled = !options.log; if (options.logger && typeof options.logger === 'function') log.logger = options.logger; options.dist = options.dist || path.join(process.cwd(), 'fonts'); options.src = options.src || path.join(process.cwd(), 'svg'); diff --git a/src/utils.ts b/src/utils.ts index ec181876..a63a8616 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -30,6 +30,7 @@ export function createSVG(options: SvgToFontOptions = {}): Promise { // init const fontStream = new SVGIcons2SVGFont({ + log: (message) => log.log(message), ...options.svgicons2svgfont }); diff --git a/test/example/index.js b/test/example/index.js index 54a97b78..98ee79a2 100644 --- a/test/example/index.js +++ b/test/example/index.js @@ -65,5 +65,5 @@ svgtofont({ } }) .then(() => { - console.log("done!"); + console.log("Example::::done!"); });