Generic module logger setup function
This can be used directly by modules or through the export_middleware_module macro
Note: This function is not FFI-safe due to &str parameter, use the macro instead
Generic middleware creation function
Creates a middleware instance of type T and returns it as a fat pointer