summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/log.c b/src/log.c
deleted file mode 100644
index 64d738c..0000000
--- a/src/log.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <stdio.h>
-#include "ipc.c"
-#include "unistd.h"
-
-int main(int argc, char** argv) {
- mqd_t rx = mq_open("/logs", O_CREAT | O_RDONLY, 0666, &attr);
- mqd_t _ = mq_open("/server_to_engine", O_CREAT, 0666, &attr);
- _ = mq_open("/engine_to_server", O_CREAT, 0666, &attr);
-
- for (int i = 1; i < argc; i++) {
- printf("Running: %s\n", argv[i]);
- if (fork() == 0) {
- char* new_argv[] = {argv[i], NULL};
- execvp(argv[i], new_argv);
- }
- }
-
- while (1) {
- char* buf = read_queue(rx);
- if (buf[0] == 'e') {
- printf("[\x1b[31mERRO\x1b[0m] %s\n", buf + 1);
- } else if (buf[0] == 'w') {
- printf("[\x1b[1;33mWARN\x1b[0m] %s\n", buf + 1);
- } else if (buf[0] == 'i') {
- printf("[\x1b[32mINFO\x1b[0m] %s\n", buf + 1);
- }
- free(buf);
- }
-}