Skip to content

PluginLogger

Plugin logger proxy interface.

typescript
import type { PluginLogger } from '@meng-xi/vite-plugin/logger'

Interface

typescript
interface PluginLogger {
	success(message: string, data?: any): void
	info(message: string, data?: any): void
	warn(message: string, data?: any): void
	error(message: string, data?: any): void
}

Methods

MethodIconColorDescription
successGreenSuccess
infoℹ️CyanInfo
warn⚠️YellowWarning
errorRedError

Additional Data

All methods support optional additional data.

typescript
logger.info('Copy complete', { files: 10, time: '150ms' })
// ℹ️ [@meng-xi/vite-plugin:my-plugin] Copy complete { files: 10, time: '150ms' }

Released under the MIT License.