Files
LLog/test/test.c

24 lines
872 B
C
Raw Permalink 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);
lTimespan* time_object = &logger->timers.items[timer].time;
start_timer(logger, timer);
2026-05-19 01:16:39 -05:00
2026-05-19 18:33:37 -05:00
sleep(2);
2026-05-19 01:16:39 -05:00
2026-05-19 22:25:09 -05:00
stop_timer(logger, timer);
lLog(logger, lINFO, lLogString_new("%f seconds.", difftime(time_object->end, time_object->start)));
2026-05-18 16:21:05 -05:00
}