Handle the variadic args for inline console.logs

This commit is contained in:
Orta Therox
2019-08-06 14:09:37 -04:00
parent f04c7ed833
commit f8b7a05777

View File

@@ -975,7 +975,7 @@ namespace ts.server {
// the log. This is so that language service plugins which use
// console.log don't break the message passing between tsserver
// and the client
console.log = (msg) => logger.msg(msg, Msg.Info);
console.warn = (msg) => logger.msg(msg, Msg.Err);
console.error = (msg) => logger.msg(msg, Msg.Err);
console.log = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Info);
console.warn = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Err);
console.error = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Err);
}