-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.h
More file actions
33 lines (23 loc) · 779 Bytes
/
logger.h
File metadata and controls
33 lines (23 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef DISTRIBUTED_N_LOGGER_H
#define DISTRIBUTED_N_LOGGER_H
#include <stdio.h>
#include <stdarg.h>
#include "common.h"
/*
* %ld - local if
* from %d - sender id
* to %d - receiver id
* %s - pipe end type: e.g. r-end or w-end
*/
static const char *const log_opened_channel_fmt =
"[+] channel from %ld to %ld: r-end - %d, w-end - %d\n";
static const char *const log_closed_mine_channels_fmt =
"[-] mine in %d: from %d to %d: %s - %d\n";
static const char *const log_closed_foreign_channels_fmt =
"[-] not mine in %ld: from %ld to %ld: %s - %d\n";
extern FILE *events_log_f;
extern FILE *pipes_log_f;
int init_log();
int close_log();
int write_log(FILE *log_file, const char *log_format, ...);
#endif //DISTRIBUTED_N_LOGGER_H