The kernel can't use the C Standard I/O facilities. It must use a logging facility.
For example, sys/netinet/in.c
uses
log(LOG_INFO, "in_scrubprefix: err=%d, old prefix delete failed\n", error);
to communicate to the world outside what happened.