Added a function to log.c that does the buffer creation