Log functions rewritten to not use Lua builtins but C equals. Also static buffer is used for log lines up to 4096 bytes.