diff --git a/lib/c/criu.h b/lib/c/criu.h index c32f66418..949902f55 100644 --- a/lib/c/criu.h +++ b/lib/c/criu.h @@ -28,6 +28,13 @@ extern "C" { #endif +#define CRIU_LOG_UNSET (-1) +#define CRIU_LOG_MSG (0) /* Print message regardless of log level */ +#define CRIU_LOG_ERROR (1) /* Errors only */ +#define CRIU_LOG_WARN (2) /* Warnings */ +#define CRIU_LOG_INFO (3) /* Informative */ +#define CRIU_LOG_DEBUG (4) /* Debug only */ + enum criu_service_comm { CRIU_COMM_SK, CRIU_COMM_FD, CRIU_COMM_BIN }; enum criu_cg_mode { diff --git a/test/others/libcriu/test_iters.c b/test/others/libcriu/test_iters.c index 2a5ca6def..b7e325abb 100644 --- a/test/others/libcriu/test_iters.c +++ b/test/others/libcriu/test_iters.c @@ -106,7 +106,7 @@ int main(int argc, char **argv) criu_set_service_binary(argv[1]); criu_set_pid(pid); criu_set_log_file("dump.log"); - criu_set_log_level(4); + criu_set_log_level(CRIU_LOG_DEBUG); open_imgdir(); ret = criu_dump_iters(next_iter); @@ -121,7 +121,7 @@ int main(int argc, char **argv) printf("--- Restore loop ---\n"); criu_init_opts(); - criu_set_log_level(4); + criu_set_log_level(CRIU_LOG_DEBUG); criu_set_log_file("restore.log"); criu_set_images_dir_fd(cur_imgdir); diff --git a/test/others/libcriu/test_notify.c b/test/others/libcriu/test_notify.c index 66fe75338..9a54b812a 100644 --- a/test/others/libcriu/test_notify.c +++ b/test/others/libcriu/test_notify.c @@ -71,7 +71,7 @@ int main(int argc, char **argv) criu_set_service_binary(argv[1]); criu_set_pid(pid); criu_set_log_file("dump.log"); - criu_set_log_level(4); + criu_set_log_level(CRIU_LOG_DEBUG); criu_set_notify_cb(notify); fd = open(argv[2], O_DIRECTORY); criu_set_images_dir_fd(fd); diff --git a/test/others/libcriu/test_self.c b/test/others/libcriu/test_self.c index 468edc0f7..0a7e63a58 100644 --- a/test/others/libcriu/test_self.c +++ b/test/others/libcriu/test_self.c @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) } criu_set_images_dir_fd(fd); - criu_set_log_level(4); + criu_set_log_level(CRIU_LOG_DEBUG); printf("--- Start child ---\n"); pid = fork(); diff --git a/test/others/libcriu/test_sub.c b/test/others/libcriu/test_sub.c index 41b685847..697abf5d5 100644 --- a/test/others/libcriu/test_sub.c +++ b/test/others/libcriu/test_sub.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) criu_set_service_binary(argv[1]); criu_set_pid(pid); criu_set_log_file("dump.log"); - criu_set_log_level(4); + criu_set_log_level(CRIU_LOG_DEBUG); fd = open(argv[2], O_DIRECTORY); criu_set_images_dir_fd(fd); @@ -85,7 +85,7 @@ int main(int argc, char **argv) printf("--- Restore loop ---\n"); criu_init_opts(); - criu_set_log_level(4); + criu_set_log_level(CRIU_LOG_DEBUG); criu_set_log_file("restore.log"); criu_set_images_dir_fd(fd);