Does -2 log messages?

In the line from the standard tick setup:

if[0<=type i;-2 (string L)," is a corrupt log. Truncate to length “,(string last i),” and restart";exit 1];hopen L};

What is -2 doing? I assume it logs the message?

Where does it log the message to?
Is this -2 a kdb thing or is this bash scripting?
Finally, is there an documentation on the use of -2 here.

2 is the permanent connection handle for stderr. See https://code.kx.com/q/basics/handles/