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

karma should write errors to stderr and return an exit code #1011

Closed
sylvain-hamel opened this issue Apr 8, 2014 · 3 comments
Closed

karma should write errors to stderr and return an exit code #1011

sylvain-hamel opened this issue Apr 8, 2014 · 3 comments

Comments

@sylvain-hamel
Copy link
Contributor

When an error occurs, karma uses log.error() to print the error. However it writes to stdout instead of stderr. Moreover, no error exist code is returned.

@josh-bradley
Copy link
Contributor

@sylvain-hamel how were you thinking codes should be handled? Should the log.error() take the exit code as a parameter and write it out to the log?

@vojtajina
Copy link
Contributor

Writing errors into stderr is easy, I think logger should be responsible for that. The default console logger should just use console.error for errors, which writes to stderr.

Handling the exit code is little bit more complicated. I think it should not be a responsibility of the logger - logger should just output logs. We should probably emit error event on the global emitter and listen on this event and 1/ clean up (eg. kill all launchers) 2/ call done callback (which is process.exit(code) by default, but could also be just a function in the case something is calling karma programatically)

@vojtajina vojtajina added this to the Backlog milestone May 10, 2014
srawlins added a commit to srawlins/karma that referenced this issue Nov 6, 2014
Log errors, by default, to a new jog4js appender, the std_appender. This
new appender logs ERROR level events with console.error, and all other
events with console.log.

Closes karma-runner#1011
@dignifiedquire
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants