AERN: Authenticated Encrypted Relay Network 1.0.0.0a (A1)
A post quantum authenticated and encrypted proxy chain network
logger.h
Go to the documentation of this file.
1/* 2025 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE: This software and all accompanying materials are the exclusive
5 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
6 * The intellectual and technical concepts contained within this implementation
7 * are proprietary to QRCS and its authorized licensors and are protected under
8 * applicable U.S. and international copyright, patent, and trade secret laws.
9 *
10 * CRYPTOGRAPHIC STANDAARS:
11 * - This software includes implementations of cryptographic algorithms such as
12 * SHA3, AES, and others. These algorithms are public domain or standardized
13 * by organizations such as NIST and are NOT the property of QRCS.
14 * - However, all source code, optimizations, and implementations in this library
15 * are original works of QRCS and are protected under this license.
16 *
17 * RESTRICTIONS:
18 * - Redistribution, modification, or unauthorized distribution of this software,
19 * in whole or in part, is strictly prohibited.
20 * - This software is provided for non-commercial, educational, and research
21 * purposes only. Commercial use in any form is expressly forbidden.
22 * - Licensing and authorized distribution are solely at the discretion of QRCS.
23 * - Any use of this software implies acceptance of these restrictions.
24 *
25 * DISCLAIMER:
26 * This software is provided "as is," without warranty of any kind, express or
27 * implied, including but not limited to warranties of merchantability or fitness
28 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
29 * incidental, or consequential damages resulting from the use or misuse of this software.
30 *
31 * FULL LICENSE:
32 * This software is subject to the **Quantum Resistant Cryptographic Solutions
33 * Proprietary License (QRCS-PL)**. The complete license terms are included
34 * in the LICENSE.txt file distributed with this software.
35 *
36 * Written by: John G. Underhill
37 * Contact: contact@qrcscorp.ca
38 */
39
40#ifndef AERN_LOG_H
41#define AERN_LOG_H
42
43#include "aerncommon.h"
44#include "commands.h"
45
73
77#define AERN_LOGGING_MESSAGE_MAX 256U
78
82#define AERN_LOG_STRING_DEPTH 69U
83
87#define AERN_LOG_STRING_SIZE 64U
88
92static const char AERN_LOGGER_PATH[] = "AERN";
93
97static const char AERN_LOGGER_FILE[] = "aern.log";
98
102static const char AERN_LOGGER_HEAD[] = "AERN Version 1.0";
103
113AERN_EXPORT_API void logger_default_path(char* path, size_t pathlen);
114
124AERN_EXPORT_API bool aern_logger_dispose(const char* path);
125
135AERN_EXPORT_API bool aern_logger_erase_all(const char* path);
136
144AERN_EXPORT_API bool aern_logger_exists(const char* path);
145
153AERN_EXPORT_API void aern_logger_initialize(const char* path);
154
164AERN_EXPORT_API size_t aern_logger_get_size(const char* path);
165
173AERN_EXPORT_API void aern_logger_reset(const char* path);
174
186AERN_EXPORT_API size_t aern_logger_write_message(const char* path, const char* line, size_t linelen);
187
201AERN_EXPORT_API size_t aern_logger_write_decorated_message(const char* path, aern_application_messages msgtype, const char* message, size_t msglen);
202
214AERN_EXPORT_API size_t aern_logger_write_time_stamped_message(const char* path, const char* message, size_t msglen);
215
229AERN_EXPORT_API size_t aern_logger_write_decorated_time_stamped_message(const char* path, aern_application_messages msgtype, const char* message, size_t msglen);
230
240AERN_EXPORT_API size_t aern_logger_read_all(const char* path, char* output, size_t outlen);
241
252AERN_EXPORT_API int64_t aern_logger_read_line(const char* path, char* output, size_t outlen, size_t linenum);
253
264AERN_EXPORT_API size_t aern_logger_time_stamp(char* output, size_t outlen);
265
266#endif
The AERN command enumerations.
aern_application_messages
The ARS application messages.
Definition commands.h:73
AERN_EXPORT_API size_t aern_logger_write_message(const char *path, const char *line, size_t linelen)
Write a message to the log file.
Definition logger.c:149
AERN_EXPORT_API size_t aern_logger_read_all(const char *path, char *output, size_t outlen)
Read the entire log into a character array.
Definition logger.c:268
AERN_EXPORT_API size_t aern_logger_get_size(const char *path)
Get the size of the log file.
Definition logger.c:113
AERN_EXPORT_API bool aern_logger_exists(const char *path)
Check if the log file exists.
Definition logger.c:94
AERN_EXPORT_API size_t aern_logger_write_decorated_time_stamped_message(const char *path, aern_application_messages msgtype, const char *message, size_t msglen)
Write a decorated, time-stamped message to the log file.
Definition logger.c:210
AERN_EXPORT_API void aern_logger_reset(const char *path)
Reset the logger.
Definition logger.c:132
AERN_EXPORT_API size_t aern_logger_write_decorated_message(const char *path, aern_application_messages msgtype, const char *message, size_t msglen)
Write a decorated message to the log file.
Definition logger.c:180
AERN_EXPORT_API int64_t aern_logger_read_line(const char *path, char *output, size_t outlen, size_t linenum)
Read a single line from the log file.
Definition logger.c:293
AERN_EXPORT_API bool aern_logger_erase_all(const char *path)
Erase the log file.
Definition logger.c:73
AERN_EXPORT_API size_t aern_logger_time_stamp(char *output, size_t outlen)
Write a timestamp to a string.
Definition logger.c:318
AERN_EXPORT_API void aern_logger_initialize(const char *path)
Initialize the logger.
Definition logger.c:39
AERN_EXPORT_API void logger_default_path(char *path, size_t pathlen)
Get the default logging path.
Definition logger.c:12
AERN_EXPORT_API size_t aern_logger_write_time_stamped_message(const char *path, const char *message, size_t msglen)
Write a time-stamped message to the log file.
Definition logger.c:238
AERN_EXPORT_API bool aern_logger_dispose(const char *path)
Erase and delete the log file.
Definition logger.c:52