log4js and winston loggers conflicting when trying to run karma from ionic cli

喜你入骨 提交于 2019-12-24 02:17:28

问题


I'm trying to run karma as a webpack plugin. This is just:

var Server = require('karma').Server;
new Server({
  configFile: config,
  singleRun: true
}, doneCallback }).start();

The outer ionic-cli package is using winston logger while karma uses log4js and I assume they're conflicting so as a result I'm getting errors like:

24 02 2016 00:54:52.530:ERROR [karma]: [TypeError: Can't call method on  undefined]
TypeError: Can't call method on  undefined
at TypeError (native)
at module.exports (/Users/szymon/git/ionic-movie-app/node_modules/karma/node_modules/core-js/modules/_defined.js:3:28)
at createHTML (/Users/szymon/git/ionic-movie-app/node_modules/karma/node_modules/core-js/modules/_string-html.js:7:19)
at bold (/Users/szymon/git/ionic-movie-app/node_modules/karma/node_modules/core-js/modules/es6.string.bold.js:5:12)
at cb (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/winston/lib/winston/logger.js:206:7)

because the two loggers are overriding something probably on String prototype. I wonder what are the possibilities to avoid this. I assume that it is not an option to alter either karma or ionic packages.

来源:https://stackoverflow.com/questions/35597719/log4js-and-winston-loggers-conflicting-when-trying-to-run-karma-from-ionic-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!