add formatting to lLogString

This commit is contained in:
2026-05-19 18:33:37 -05:00
parent ba2df46189
commit fbb618711f
3 changed files with 26 additions and 14 deletions

View File

@@ -1,20 +1,19 @@
#include "../include/LLog.h"
#include <stdio.h>
#include <unistd.h>
int main(void) {
Logger logger = {0};
lLog(logger, lINFO, to_lLogString("Hello, INFO!"));
lLog(logger, lWARNING, to_lLogString("Hello, WARNING!"));
lLog(logger, lERROR, to_lLogString("Hello, ERROR!"));
lLog(logger, lDEBUG, to_lLogString("Hello, DEBUG!"));
lLog(logger, lINFO, lLogString_new("Hello, INFO!"));
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);
sleep(5);
sleep(2);
stop_timer(&logger, timer);
printf("\n%f seconds.\n", difftime(time_object->end, time_object->start));
lLog(logger, lINFO, lLogString_new("%f seconds.", difftime(time_object->end, time_object->start)));
}