You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pylance now reports problems that each of the parameters do not exist
log.info('hello {name}', name='Mark')
Error shown: No parameter named "name" (Pylance reportGeneralTypeIssues)
I asked them and they said that I should use a seq specific log function from seqlog instead of the standard one. What would be your recommended way to use seqlog and also have pylances type checking enabled?
The text was updated successfully, but these errors were encountered:
The Pylance team was correct, in the stdlib logging module the level-based functions support **kwargs, but the base log function doesn't. **kwargs is implemented in seqlog's main log function to add properties to what it sends to the Seq server, but those properties are not passed back to the stdlib logging module functions.
How are you initializing the logging or seqlog modules?
If you don't use override_root_logger=True when you call log_to_seq() the standard logging.info() function would send the logs to the default/root logger, which is not the seqlog logger.
Looks like you were calling log.info() though, so I'm curious: how are you initializing the logging and/or seqlog modules? Could you provide a little context?
This issue seems the same as #41. which has a bit more in-depth discussion about this topic.
Also the official documentation for the stdlib logging module uses args (when provided) to merge into msg before returning the string via getMessage() or logging it via log().
The seqlog documentation may need an update in this regard (at least for clarity's sake), but technically there is a name argument for a log record that's separate from the args argument, but it's for telling the main logging module which logger to send the log to.
I'll see about updating the documentation here to reflect the above details.
Pylance now reports problems that each of the parameters do not exist
Error shown:
No parameter named "name" (Pylance reportGeneralTypeIssues)
I asked them and they said that I should use a seq specific log function from seqlog instead of the standard one. What would be your recommended way to use seqlog and also have pylances type checking enabled?
The text was updated successfully, but these errors were encountered: