ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
named.c File Reference

Format named objects in log messages (replaces hex addresses with type/name descriptions) More...

Go to the source code of this file.

Data Structures

struct  type_check_context
 Check if a type string is actually registered in the named registry. More...
 

Macros

#define NAMED_FORMAT_BUFFER_SIZE   (4096)
 
#define COLORIZE_BUFFERS   4
 
#define COLORIZE_BUFFER_SIZE   512
 

Functions

int log_named_format_message (const char *message, char *output, size_t output_size)
 Format hex addresses in a message as named object descriptions.
 
const char * log_named_format_or_original (const char *message)
 Format named objects in a message (thread-local buffer)
 
const char * colorize_named_string (const char *name_str)
 Colorize a "type/name (0xaddress)" string for display in memory reports.
 

Detailed Description

Format named objects in log messages (replaces hex addresses with type/name descriptions)

This module scans log message text for hex addresses (0x[0-9a-fA-F]+) and replaces them with friendly descriptions from the named object registry when available. For example, 0x7f1234567890 might become "mutex/recv_mutex.2 (0x7f1234567890)"

Output is colorized for better readability:

  • Type name: yellow (LOG_COLOR_WARN)
  • Name: orange (LOG_COLOR_DEV)
  • ID value: grey (LOG_COLOR_GREY)

Definition in file log/named.c.

Macro Definition Documentation

◆ COLORIZE_BUFFER_SIZE

#define COLORIZE_BUFFER_SIZE   512

◆ COLORIZE_BUFFERS

#define COLORIZE_BUFFERS   4

◆ NAMED_FORMAT_BUFFER_SIZE

#define NAMED_FORMAT_BUFFER_SIZE   (4096)

Definition at line 25 of file log/named.c.