def inject_logging(db: SofterCouchDB, logger: Logger): """ Inject CouchDB response time logging into a SofterCouchDB instance, targeting all callable, "public" attributes. Note that we can only inject into instantiated SofterCouchDBs because they are monkey- patched themselves; as such, we can't use the mass mapping convenience functions of the injector. @param db The SofterCouchDB instance to inject into @param logger The logger to write to """ mapping = LoggingMapper(logger) mapping.map_logging_to_public_methods(db, _CouchDBResponseTimeLogging) mapping.inject_logging(db)