CommitLogBuffer

Function CommitLogBuffer(context :^loggingContexts) : Boolean

context: A loggingContext created by CreateLoggingContext

Returns TRUE on success

This function writes any entries stored in a log's buffer to file. This has no effect if the loggingContext is realtime. (see a guide to hlog).

This function is automatically called when the loggingContext is freed using FreeLoggingContext or FreeAllLoggingContexts.

The buffer is cleared after it has been commited.

Example:

Program
   Uses

       hlog

Var
   verboseLog: ^loggingContexts
   debugLog: ^loggingContexts
   errorLog: ^loggingContexts
   
   i : Integer
   
Begin
   verboseLog = CreateLoggingContext("verbose.log", FALSE)
   debugLog = CreateLoggingContext("debug.log", TRUE)
   errorLog = CreateLoggingContext("error.log", TRUE)

   For i = 0 to 50
       LogMsg(verboseLog, "i="+i)
   Next
   
   MessageBox("Notice that the verbose.log hasn't yet been written to yet")

   CommitLogBuffer(verboseLog)
   
   MessageBox("Now it has!")
End