Inital Commit
This commit is contained in:
commit
cc95ff1c3a
22 changed files with 1166 additions and 0 deletions
15
utils/logger.c
Normal file
15
utils/logger.c
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include "logger.h"
|
||||
|
||||
|
||||
void logger(char message[255]){
|
||||
FILE *log_file;
|
||||
time_t t = time(NULL);
|
||||
struct tm tm = *localtime(&t);
|
||||
log_file = fopen("output.log", "a");
|
||||
fprintf(log_file, "[%d-%02d-%02d %02d:%02d:%02d] ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
fprintf(log_file, "%s\n", message);
|
||||
fclose(log_file);
|
||||
}
|
||||
Reference in a new issue