Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get log from svrx, not in console #70

Open
imyzf opened this issue Aug 28, 2019 · 1 comment
Open

Get log from svrx, not in console #70

imyzf opened this issue Aug 28, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@imyzf
Copy link

imyzf commented Aug 28, 2019

Is your feature request related to a problem? Please describe.

I want to get log from svrx, like webpack's log.

Describe the solution you'd like

Maybe an event to listen to logs.

@imyzf imyzf added the enhancement New feature or request label Aug 28, 2019
@leeluolee leeluolee self-assigned this Oct 22, 2019
@leeluolee leeluolee added this to the v1.0.5 milestone Oct 25, 2019
@leeluolee
Copy link
Contributor

solution

Add logger events

svrx().on('logger', payload=>{


})

Param

  • payload.message [String]: output message and its style has been removed
  • payload.level [String]: log level (error ,notify etc. )
  • payload.plugin [String] : The name of the plugin (Empty if it does not exist)

By default, the logger will be output on the terminal. You can use evt.prevent=true to stop this behavior

svrx().on('logger', (payload, evt)=>{
   evt.prevent = true;
})

@xuchaoying xuchaoying removed this from the v1.0.5 milestone Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants