1register_trace_handler(3) Allegro manual register_trace_handler(3)
2
3
4
6 register_trace_handler - Registers a custom handler for trace output.
7 Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 void register_trace_handler(int (*handler)(const char *msg));
14
16 Supplies a custom handler function for dealing with trace output. Your
17 callback will be passed a formatted error message in ASCII, and should
18 return non-zero if it has processed the message, or zero to continue
19 with the default actions. You could use this to ignore trace output, or
20 to display the messages on a second monochrome monitor, etc. You can
21 call this function even when Allegro has not been initialised. Example:
22
23 int network_broadcaster(const char *text)
24 {
25 int f;
26
27 for (int f = 0; f
28 send_msg_to_client(client[f], text);
29
30 return 0; /* Let normal tracing occur. */
31 }
32 ...
33 register_trace_handler(network_broadcaster);
34 TRACE("Networked tracing activated\n");
35
36
38 al_trace(3), TRACE(3), register_assert_handler(3)
39
40
41
42Allegro version 4.4.3 register_trace_handler(3)