Closed MartinThoma closed 3 years ago
I'll happily pitch in, if any help is needed on this.
@MartinThoma you should be able to get the types by doing something like:
def add_fields(self, *args, **kwargs):
for pos, arg in enumerate(args):
print(f"Arg {pos}:\t{type(arg)} -> {arg}"
for kw, arg in kwargs.items():
print(f"Kwarg {kw}:\t{type(arg)} -> {arg}")
Then of course just fire up a logging instance and log something. It's probably gonna pitch a fit so it'll probably be messy in the console, but it should also tell you what you'd like to know.
Thank you for the support. I no longer have access to that code, so I cannot tell what the solution was/is.
I'm currently annotating a code base and wonder what the types of
add_fields(self, log_record, record, message_dict)
are. My current best guess:What is
log_record
? Maybe aDict
?On a more general note: What do you think about adding type annotations? As you still support Python 3.4 and 3.5, they should be added as type stubs. If you want, I can help you get started :-)