I am trying to create a concrete implementation of ILogger in python using the build in python logger.
However, when I try to implement the ILogger interface, I'm getting the exception
Method 'Log' in type 'Microsoft.Extensions.Logging.PyLogger' from assembly 'Python.Runtime.Dynamic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
The code so far is simple and incomplete
class PyLogger(ILogger):
__namespace__ = "Microsoft.Extensions.Logging"
def Log(self, logLevel, eventId, state, exception, formatter):
print(logLevel, eventId, state, exception, formatter)
return
def IsEnabled(self):
return True
I don't understand why it doesn't like my Log
definition.
When I inspect ILogger.Log
it get the following, which looks complete.
>>> inspect.signature(ILogger.Log)
<Signature (logLevel, eventId, state, exception, formatter)>