Files
LLog/test/test.c

27 lines
886 B
C
Raw Normal View History

2026-05-18 16:21:05 -05:00
#include "../include/LLog.h"
2026-05-19 01:16:39 -05:00
#include <unistd.h>
2026-05-18 16:21:05 -05:00
int main(void) {
2026-05-19 22:25:09 -05:00
Logger* logger = Logger_new(lLogString_new("./logs"), 1);
2026-05-20 15:38:30 -05:00
lLog(logger, lINFO, lLogString_new("Author: %s", LLog_Author));
lLog(logger, lINFO, lLogString_new("Repo: %s", LLog_Repo));
lLog(logger, lINFO, lLogString_new("Version: %s\n", LLog_Version));
2026-05-19 22:25:09 -05:00
lLog(logger, lINFO, lLogString_new("Hello, INFO!"));
2026-05-19 18:43:57 -05:00
2026-05-19 22:25:09 -05:00
lLog(logger, lWARNING, lLogString_new("Hello, WARNING!"));
lLog(logger, lERROR, lLogString_new("Hello, ERROR!"));
lLog(logger, lDEBUG, lLogString_new("Hello, DEBUG!"));
int timer = create_timer(logger);
2026-05-19 22:25:09 -05:00
start_timer(logger, timer);
2026-05-19 01:16:39 -05:00
sleep(4);
pause_timer(logger, timer);
sleep(2);
resume_timer(logger, timer);
2026-05-19 18:33:37 -05:00
sleep(2);
2026-05-19 22:25:09 -05:00
stop_timer(logger, timer);
lLog(logger, lINFO, lLogString_new("%f seconds.", get_elapsed_time(logger, timer)));
2026-05-18 16:21:05 -05:00
}