Skip to content

Commit

Permalink
fix: fix log options issue. (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 10, 2022
1 parent b5398f0 commit 9b9a471
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function createSVG(options: SvgToFontOptions = {}): Promise<Record<string
return new Promise((resolve, reject) => {
// init
const fontStream = new SVGIcons2SVGFont({
log: (message) => log.log(message),
...options.svgicons2svgfont
});

Expand Down
2 changes: 1 addition & 1 deletion test/example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ svgtofont({
}
})
.then(() => {
console.log("done!");
console.log("Example::::done!");
});

0 comments on commit 9b9a471

Please sign in to comment.