77#define MPDC_LOGGING_MESSAGE_MAX 256
82#define MPDC_LOG_STRING_DEPTH 69
87#define MPDC_LOG_STRING_SIZE 64
92static const char MPDC_LOGGER_PATH[] =
"MPDC";
97static const char MPDC_LOGGER_FILE[] =
"mpdc.log";
102static const char MPDC_LOGGER_HEAD[] =
"MPDC Version 1.0";
252MPDC_EXPORT_API int64_t
mpdc_logger_read_line(
const char* path,
char* output,
size_t outlen,
size_t linenum);
The MPDC command enumerations.
mpdc_application_messages
The RDS application messages.
Definition commands.h:73
MPDC_EXPORT_API void mpdc_logger_reset(const char *path)
Reset the logger.
Definition logger.c:132
MPDC_EXPORT_API size_t mpdc_logger_write_decorated_message(const char *path, mpdc_application_messages msgtype, const char *message, size_t msglen)
Write a decorated message to the log file.
Definition logger.c:180
MPDC_EXPORT_API size_t mpdc_logger_write_decorated_time_stamped_message(const char *path, mpdc_application_messages msgtype, const char *message, size_t msglen)
Write a decorated, time-stamped message to the log file.
Definition logger.c:210
MPDC_EXPORT_API size_t mpdc_logger_time_stamp(char *output, size_t outlen)
Write a timestamp to a string.
Definition logger.c:318
MPDC_EXPORT_API size_t mpdc_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
MPDC_EXPORT_API size_t mpdc_logger_get_size(const char *path)
Get the size of the log file.
Definition logger.c:113
MPDC_EXPORT_API bool mpdc_logger_exists(const char *path)
Check if the log file exists.
Definition logger.c:94
MPDC_EXPORT_API bool mpdc_logger_dispose(const char *path)
Erase and delete the log file.
Definition logger.c:52
MPDC_EXPORT_API size_t mpdc_logger_write_message(const char *path, const char *line, size_t linelen)
Write a message to the log file.
Definition logger.c:149
MPDC_EXPORT_API void mpdc_logger_initialize(const char *path)
Initialize the logger.
Definition logger.c:39
MPDC_EXPORT_API size_t mpdc_logger_read_all(const char *path, char *output, size_t outlen)
Read the entire log into a character array.
Definition logger.c:268
MPDC_EXPORT_API bool mpdc_logger_erase_all(const char *path)
Erase the log file.
Definition logger.c:73
MPDC_EXPORT_API int64_t mpdc_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
MPDC_EXPORT_API void logger_default_path(char *path, size_t pathlen)
Get the default logging path.
Definition logger.c:12