sg-wireless / pymakr-vsc

GNU General Public License v3.0
97 stars 25 forks source link

logging: #220

Closed Josverl closed 2 years ago

Josverl commented 2 years ago
jakobrosenberg commented 2 years ago

Love it!

Should the "what" precede the "where"?

Eg. should:

  if (data instanceof Error) {
    return data.stack || data.message;
  }

be

  // I'm leaning towards this one since the stack can be found in the developer console.
  if (data instanceof Error) {
    return data.message || data.stack;
  }

or

  if (data instanceof Error) {
    return [data.message, data.stack].filter(Boolean).join('\r\n');
  }
Josverl commented 2 years ago

makes sense, and I think it also makes sense to log the error to the log , but log all the details of the connection / failure using log.debug so that can be hidden / revealed by changing the log level.

jakobrosenberg commented 2 years ago

Yes, I've been meaning to revise the logging levels and coverage, but the priority hasn't been high so far.

jakobrosenberg commented 2 years ago

:tada: This PR is included in version 2.8.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: