<commit_before># SimpleLog
Windows Multi-Thread Safe Lite Logging

## Usage
To disable logging use the `DISABLE_LOGGING_` macro define.

Include the `eventlog.h` file into all `.cpp` files you want to run the event log in.

Call the EventLog initialisation function:

```C++
OPEN_LOG(
	const TSTRING filename,
	const TSTRING path,
	const EventLevel level,
	const int wait,
	const int maxqueue )
```

Store the result in an `auto_ptr<LogHandle>` with the scope of your choosing.
When the auto_ptr goes out of scope the log file's internal reference count will decrease.
If the internal reference count of the log file has reached 0 then the log will be flushed and closed.

Write to the log exactly like `printf` except with a logging level at the front.

## Basic Example

```C++
#include "eventlog.h"

int
main( int argc, char* argv[] )
{
	LOGHANDLE logFile = OPEN_LOG( TEXT("SimpleLog_Test.log") );

	LOG_CRIT( logFile, TEXT("Lets log a Number! -- %d"), 42 );
	LOG_CRIT( logFile, TEXT("Logging Test Success.") );

	return 0;
}
```

## Mutli-Threaded Example

```C++<commit_msg>Small updates to front page.<commit_after># SimpleLog
Thread Safe Asynchronous Logging for C++ programs based on Windows.

## Usage
To disable logging use the `DISABLE_LOGGING_` macro define.

Include the `eventlog.h` file into all `.cpp` files you want to run the event log in.

Call the EventLog initialisation function:

```C++
OPEN_LOG(
	const TSTRING filename,
	const TSTRING path,
	const EventLevel level,
	const int wait,
	const int maxqueue )
```

Store the result in a `LOGHANDLE` with the scope of your choosing.
When the `LOGHANDLE` goes out of scope the log file's internal reference count will decrease.
If the internal reference count of the log file has reached 0 then the log will be flushed and closed.

Write to the log exactly like `printf` except with a logging level at the front.

## Basic Example

```C++
#include "eventlog.h"

int
main( int argc, char* argv[] )
{
	LOGHANDLE logFile = OPEN_LOG( TEXT("SimpleLog_Test.log") );

	LOG_CRIT( logFile, TEXT("Lets log a Number! -- %d"), 42 );
	LOG_CRIT( logFile, TEXT("Logging Test Success.") );

	return 0;
}
```

## Mutli-Threaded Example

```C++
{'fraction_non_alphanumeric': 0.09708295350957157, 'fraction_numerical': 0.0036463081130355514, 'mean_word_length': 4.3667481662591685, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1579509', 'n_tokens_mistral': 699, 'n_tokens_neox': 677, 'n_words': 306}