diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-13 15:26:04 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-13 18:06:37 +0100 |
commit | 642b627d277cdb30b91682ba29b5c3a226d607d9 (patch) | |
tree | 2df2a73a01f7123b313ed3c23950b1437f934fff /WireGuard/Shared/Logging/ringlogger.h | |
parent | More reliable logo sizing (diff) | |
download | wireguard-apple-642b627d277cdb30b91682ba29b5c3a226d607d9.tar.xz wireguard-apple-642b627d277cdb30b91682ba29b5c3a226d607d9.zip |
Rewrite Logger
This reverts all of Roop's changes to the C code, and then rewrites the
logger logic to be cleaner.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/Shared/Logging/ringlogger.h | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/WireGuard/Shared/Logging/ringlogger.h b/WireGuard/Shared/Logging/ringlogger.h index be1d33c..ad58fb8 100644 --- a/WireGuard/Shared/Logging/ringlogger.h +++ b/WireGuard/Shared/Logging/ringlogger.h @@ -6,25 +6,10 @@ #ifndef RINGLOGGER_H #define RINGLOGGER_H -enum { - MAX_LOG_LINE_LENGTH = 512, - MAX_LINES = 1024, - MAGIC = 0xdeadbeefU -}; - -struct log_line { - struct timeval tv; - char line[MAX_LOG_LINE_LENGTH]; -}; - -struct log { - struct { uint32_t first, len; } header; - struct log_line lines[MAX_LINES]; - uint32_t magic; -}; - +struct log; void write_msg_to_log(struct log *log, const char *msg); -int write_logs_to_file(const char *file_name, const char *tag1, const struct log *log1, const char *tag2, const struct log *log2); +int write_logs_to_file(const char *file_name, const struct log *log1, const struct log *log2); struct log *open_log(const char *file_name); +void close_log(struct log *log); #endif |