Skip to content

Commit 8eeb5c7

Browse files
committed
refactor: set global logger level
1 parent e51430f commit 8eeb5c7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import type { Options as DtsOptions } from 'rolldown-plugin-dts'
4747
* Build with tsdown.
4848
*/
4949
export async function build(userOptions: Options = {}): Promise<void> {
50+
globalLogger.level =
51+
userOptions.logLevel || (userOptions.silent ? 'silent' : 'info')
5052
const { configs, files: configFiles } = await resolveOptions(userOptions)
5153

5254
let cleanPromise: Promise<void> | undefined

tests/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ test('fromVite', async (context) => {
167167
const restoreCwd = chdir(testDir)
168168
const options = await resolveOptions({
169169
config: testDir,
170+
logLevel: 'silent',
170171
})
171172
expect(options.configs).toMatchObject([
172173
{

0 commit comments

Comments
 (0)