mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
We'll use this in the next patch for printing paths to LSM files in /proc. Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
42 lines
1.0 KiB
C
42 lines
1.0 KiB
C
#ifndef __CR_LOG_H__
|
|
#define __CR_LOG_H__
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include "criu-log.h"
|
|
|
|
extern int log_init(const char *output);
|
|
extern void log_fini(void);
|
|
extern int log_init_by_pid(void);
|
|
extern void log_closedir(void);
|
|
|
|
extern void log_set_fd(int fd);
|
|
extern int log_get_fd(void);
|
|
|
|
extern void log_set_loglevel(unsigned int loglevel);
|
|
extern unsigned int log_get_loglevel(void);
|
|
|
|
#define LOG_SIMPLE_CHUNK 72
|
|
|
|
extern int vprint_num(char *buf, int blen, int num, char **ps);
|
|
extern void simple_sprintf(char output[LOG_SIMPLE_CHUNK], const char *format, ...)
|
|
__attribute__ ((__format__ (__printf__, 2, 3)));
|
|
|
|
extern int write_pidfile(int pid);
|
|
|
|
#define DEFAULT_LOGLEVEL LOG_WARN
|
|
|
|
#define DEFAULT_LOG_FILENAME "criu.log"
|
|
|
|
struct cr_img;
|
|
|
|
extern void print_data(unsigned long addr, unsigned char *data, size_t size);
|
|
extern void print_image_data(struct cr_img *, unsigned int length, int show);
|
|
|
|
static inline int pr_quelled(unsigned int loglevel)
|
|
{
|
|
return log_get_loglevel() < loglevel && loglevel != LOG_MSG;
|
|
}
|
|
|
|
#endif /* __CR_LOG_H__ */
|