fixed some style issues.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Original version can be found at: https://github.com/rxi/log.c
|
||||
*
|
||||
* Modified work Copyright (c) 2026 Emilia Marigold (AGPLv3)
|
||||
*
|
||||
@@ -33,12 +34,13 @@
|
||||
* See the LICENSE file for the full AGPLv3 terms and conditions.
|
||||
***/
|
||||
|
||||
#include "new_log.h"
|
||||
#include "log.h"
|
||||
|
||||
#define MAX_CALLBACKS 32
|
||||
|
||||
typedef
|
||||
struct callback_struct
|
||||
struct
|
||||
callback_struct
|
||||
{
|
||||
log_function function;
|
||||
void *user_data;
|
||||
@@ -46,7 +48,8 @@ struct callback_struct
|
||||
}
|
||||
callback_type;
|
||||
|
||||
static struct static_log_data_struct
|
||||
static struct
|
||||
static_log_data_struct
|
||||
{
|
||||
void *user_data;
|
||||
lock_function lock;
|
||||
@@ -62,7 +65,7 @@ level_strings[] =
|
||||
"TRACE",
|
||||
"DEBUG",
|
||||
"INFO",
|
||||
"WARNING",
|
||||
"WARN",
|
||||
"ERROR",
|
||||
"FATAL"
|
||||
};
|
||||
@@ -84,10 +87,11 @@ static void
|
||||
stdout_callback(log_event_type *event)
|
||||
{
|
||||
char buffer[16];
|
||||
|
||||
buffer[strftime(buffer,
|
||||
sizeof(buffer),
|
||||
"%H:%M:%S",
|
||||
event->local_time)] = '\0';
|
||||
sizeof(buffer),
|
||||
"%H:%M:%S",
|
||||
event->local_time)] = '\0';
|
||||
|
||||
#ifdef LOG_USE_COLOR
|
||||
fprintf(event->user_data,
|
||||
@@ -122,9 +126,9 @@ file_callback(log_event_type *event)
|
||||
{
|
||||
char buffer[64];
|
||||
buffer[strftime(buffer,
|
||||
sizeof(buffer),
|
||||
"%Y-%m-%d %H:%M:%S",
|
||||
event->local_time)] = '\0';
|
||||
sizeof(buffer),
|
||||
"%Y-%m-%d %H:%M:%S",
|
||||
event->local_time)] = '\0';
|
||||
|
||||
fprintf(event->user_data,
|
||||
"%s %-5s %s:%d: ",
|
||||
@@ -275,7 +279,7 @@ log_log(int severity_level,
|
||||
|
||||
for (int i = 0; i < MAX_CALLBACKS
|
||||
&& static_log_data_struct.callbacks[i].function;
|
||||
i++)
|
||||
i++)
|
||||
{
|
||||
callback_type *callback_pointer = &static_log_data_struct.callbacks[i];
|
||||
if (severity_level >= callback_pointer->severity_level)
|
||||
@@ -16,10 +16,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#define LOG_VERSION "r:2.26.180.1"
|
||||
#define LOG_VERSION "2.26.180a"
|
||||
|
||||
typedef
|
||||
struct log_event_struct
|
||||
struct
|
||||
log_event_struct
|
||||
{
|
||||
va_list argument_pointer;
|
||||
const char *format;
|
||||
BIN
source_code/log.o
Normal file
BIN
source_code/log.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user