Custom BuildOperationLogger

Is it possible to override the BuildOperationLogger for a given task/project?

I’m compiling a C project and I see that the default behavior of the CCompile task is to redirect the output to a file like build/tmp/output.txt. I’d like to know how to change this behavior by using a custom BuildOperationLogger. Is this possible?