my log message here is just info: after all completed
for some reason something is printing console.log
and at Console.log
as well as some blank lines for every log message.
➤ YN0000: [@bb/common-framework]: console.log
➤ YN0000: [@bb/common-framework]: info: after all completed
➤ YN0000: [@bb/common-framework]:
➤ YN0000: [@bb/common-framework]: at Console.log (../../../../../.yarn/cache/winston-npm-3.3.3-3fa4527b42-8a9d69c642.zip/node_modules/winston/lib/winston/transports/console.js:79:23)
This only seems to happen when running with
"test:graph": "yarn ts/app/service/packages/graph workspaces foreach --parallel --topological-dev --verbose --recursive run test",
":g:jest": "cd $INIT_CWD && jest --collectCoverage --colors --config ../../../../jest.config.js --rootDir .",
"test": "yarn :g:jest",
if I run a single test with, the below, everything is fine
"jest": "cd $INIT_CWD && jest --forceExit --colors --config jest-vscode.config.js",
this is basically a copy and paste of my winston configuration, but into a fresh project the problem didn't rear its head. I doubt this has anything to do with jest, but since I only see this running tests through jest and an in the loop, I can't count it out.
import { createLogger, format, transports } from "winston";
describe('something', () => {
const log = createLogger({
level: 'debug',
format: format.combine(
format.colorize({ level: true, message: false }),
format.splat(),
format.simple(),
format.align(),
format.padLevels(),
),
transports: [new transports.Console()]
})
it('hello', () => {
log.info('hello world');
})
})
These are the deps I have in the least complicated module I have showing this error.
"dependencies": {
"@aurelia/kernel": "dev",
"@js-joda/core": "npm:^3.2.0",
"@new10com/axios-logger": "^0.1.4",
"apollo-server-express": "npm:^2.18.2",
"axios": "0.21.x",
"change-case": "npm:^3.1.0",
"dotenv": "^8.2.0",
"find-up": "^5.0.0",
"graphql": "npm:^14.5.0",
"logform": "npm:^2",
"typeorm": "npm:^0.2.28",
"winston": "3"
},
"devDependencies": {
"@types/jest": "npm:26.x",
"@types/node": "12",
"jest": "npm:^26",
"ts-jest": "^26.4.1",
"type-fest": "^0.18.0",
"typescript": "^4.0.5"
}
I tried winston 3.3.3 and winston 3.2.x, same results.
Sorry that this is such a poorly reproducible issue, I know this is a long shot. If you have any ideas please share.
Looks like this is coming from jest, it doesn't always seem to do it, so I don't fully understand. https://github.com/facebook/jest/issues/9127