Logging is absolutely not irrelevant to the function of your code. It's a cornerstone of system observability along with instrumentation (metrics) and tracing. It deserves to be unit-tested, same as anything else. Loggers absolutely deserve to be injected and treated the same as any other first-order dependency.