<commit_before>## Slog Logging Library
Advanced logging library for C/C++ which parses log level from config file and prints log if log level from config is equal or higher than level argument while printing with slog() function.

### Usage
If you want to use slog, you need just two files, slog.c and slog.h
You must include slog.h header file in your code and add slog in Makefile or link it manual.
There is Makefile example in this repository and you can see it and modify.

### Simple API
At first you must initialise slog
```
slog_init("filename", 3);
```
First argument "filename" is a filename where logs will be saved.
File name will be generated from argument and also from system date.
Finally file name will be something like that:
```
filename-2015-04-02.log
```

Second argument is maximum log level.

### Config file

Slog has its config file 'slog.cfg'
Example:
```
loglevel 3
logtofile 1
```
First value is logging level to control which levels of log should be printed.

Second argument is log to file

Enable   | Disable
---------|---------
1        | 0

If 1 is given, logs will be saved in file, but it wont if argument is 0.


### Print and log something
There is an example how use slog. You can also see, compile and run example.c source file where is full functional examples of slog.
```
slog(0, "[LIVE] Test message with level 0");
```
First argument is log level and second is message to print and/or save. Slog ands strings automatically with \n.

### Version
slog_version() is a function which returns version information of slog.

Usage:
```
slog(0, "Slog Version: %s", slog_version());
```
Output will be something like that:
```
2015.05.01-15:59:58 - Slog Version: 0.2.3 Snapshot Build 16 (May  1 2015)
```

### Output
Here is example output strings of slog
```
2015.05.01-15:59:58 - [LIVE] Test message with level 0
2015.05.01-15:59:58 - [LIVE] Test message with level 1
2015.05.01-15:59:58 - [DEBUG] Test message with level 2
2015.05.01-15:59:58 - [DEBUG] Test message with level 3
2015.05.01-15:59:58 - [LIVE] Test message with char argument: test string
2015.05.01-15:59:58 - [LIVE] Test message with int argument: 69
```
<commit_msg>Description of changes<commit_after>## Slog Logging Library
Advanced logging library for C/C++ which parses log level from config file and prints log if log level from config is equal or higher than level argument while printing with slog() function.

### Usage
If you want to use slog, you need just two files, slog.c and slog.h
You must include slog.h header file in your code and add slog in Makefile or link it manual.
There is Makefile example in this repository and you can see it and modify.

### Simple API
At first you must initialise slog
```
slog_init("filename", 3);
```
First argument "filename" is a filename where logs will be saved.
File name will be generated from argument and also from system date.
Finally file name will be something like that:
```
filename-2015-04-02.log
```

Second argument is maximum log level.

### Config file

Slog has its config file 'slog.cfg'

Example:
```
loglevel 3
logtofile 1
```
First value is logging level to control which levels of log should print.

Second argument is log to file

Enable   | Disable
---------|---------
1        | 0

If 1 is given, logs will be saved in file, but it wont if argument is 0.


### Print and log something
There is an example how use slog. You can also see, compile and run example.c source file where is full functional examples of slog.
```
slog(0, "[LIVE] Test message with level 0");
```
First argument is log level and second is message to print and/or save. Slog ands strings automatically with \n.

### Version
slog_version() is a function which returns version information of slog.

Usage:
```
slog(0, "Slog Version: %s", slog_version());
```
Output will be something like that:
```
2015.05.01-15:59:58 - Slog Version: 0.2.3 Snapshot Build 16 (May  1 2015)
```

### Output
Here is example output strings of slog
```
2015.05.01-15:59:58 - [LIVE] Test message with level 0
2015.05.01-15:59:58 - [LIVE] Test message with level 1
2015.05.01-15:59:58 - [DEBUG] Test message with level 2
2015.05.01-15:59:58 - [DEBUG] Test message with level 3
2015.05.01-15:59:58 - [LIVE] Test message with char argument: test string
2015.05.01-15:59:58 - [LIVE] Test message with int argument: 69
```

{'fraction_non_alphanumeric': 0.09937888198757763, 'fraction_numerical': 0.06073153899240856, 'mean_word_length': 3.8044198895027623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2029800', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1262, 'n_words': 651}