21 lines
775 B
C
21 lines
775 B
C
#include "../include/LLog.h"
|
|
#include <unistd.h>
|
|
|
|
int main(void) {
|
|
Logger logger = {0};
|
|
int message_1_id = lLog(&logger, lINFO, lLogString_new("Hello, INFO!"));
|
|
lLog(&logger, lINFO, logger.history.items[message_1_id]);
|
|
|
|
int message_2_id = lLog(&logger, lWARNING, lLogString_new("Hello, WARNING!"));
|
|
int message_3_id = lLog(&logger, lERROR, lLogString_new("Hello, ERROR!"));
|
|
int message_4_id = 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(2);
|
|
|
|
stop_timer(&logger, timer);
|
|
lLog(&logger, lINFO, lLogString_new("%f seconds.", difftime(time_object->end, time_object->start)));
|
|
} |