Skip to content

Commit

Permalink
Handle the variadic args for inline console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Aug 6, 2019
1 parent f04c7ed commit f8b7a05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tsserver/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit f8b7a05

Please sign in to comment.