feat: logging

This commit is contained in:
2026-05-03 20:48:11 +05:30
parent d42202772d
commit f713aeca7c
4 changed files with 28 additions and 3 deletions
+19 -3
View File
@@ -1,10 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
void LOG_INFO(char *str) { printf("+ [INFO] %s\n", str); }
void LOG_LEVEL(char *str, char *level) {
if (strcmp(level, "warn") == 0) {
printf("! [WARN] %s\n", str);
return;
}
if (strcmp(level, "fatal") == 0) {
printf("!! [FATAL] %s\n", str);
}
}
// Driver Code
int main()
{
LOG_INFO("This is a Log");
LOG_LEVEL("This is a Warning", "warn");
/* LOG("HELLO"); */
return 0;
}