You cannot overwrite it, because it is a function, not a method. However, NSLog() additionally writes to stderr under some conditions as stated in the discussion of NSLogv(), which is called by NSLog():
Logs an error message to the Apple System Log facility (see man 3 asl). If the STDERR_FILENO file descriptor has been redirected away from the default or is going to a tty, it will also be written there. If you want to direct output elsewhere, you need to use a custom logging facility.
You cannot overwrite it, because it is a function, not a method. However,
NSLog()
additionally writes tostderr
under some conditions as stated in the discussion ofNSLogv()
, which is called byNSLog()
:So simply redirect
STDERR_FILENO
usingfreopen()
.