Changeset 6c52c72bfbfb9c63fd1fb6e2b7e762fbabf49591
- Timestamp:
- 25/03/08 22:14:57
(8 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1206479697 +0200
- git-parent:
[7b7d2516fcb4a501a923557ca1f9ffb5f1c77ccd]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1206479697 +0200
- Message:
Store the object type name rather than object type ID within log messages.
This remove the triplicated id to name conversion and saves many lookups.
It also removes the obnoxious "private" messages.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rdb3a33e |
r6c52c72 |
|
| 60 | 60 | int i_type; /**< message type, see below */ |
|---|
| 61 | 61 | int i_object_id; |
|---|
| 62 | | int i_object_type; |
|---|
| | 62 | const char *psz_object_type; |
|---|
| 63 | 63 | char * psz_module; |
|---|
| 64 | 64 | char * psz_msg; /**< the message itself */ |
|---|
| … | … | |
| 161 | 161 | VLC_EXPORT( msg_subscription_t*, __msg_Subscribe, ( vlc_object_t *, int ) ); |
|---|
| 162 | 162 | VLC_EXPORT( void, __msg_Unsubscribe, ( vlc_object_t *, msg_subscription_t * ) ); |
|---|
| 163 | | |
|---|
| 164 | | VLC_EXPORT(const char *, msg_GetObjectTypeName, (int i_object_type )); |
|---|
| 165 | 163 | |
|---|
| 166 | 164 | /** |
|---|
| r99fab90 |
r6c52c72 |
|
| 55 | 55 | |
|---|
| 56 | 56 | int i_start, oldLength; |
|---|
| 57 | | char * psz_module_type = NULL; |
|---|
| | 57 | const char * psz_module_type = NULL; |
|---|
| 58 | 58 | rgb_color red = { 200, 0, 0 }; |
|---|
| 59 | 59 | rgb_color gray = { 150, 150, 150 }; |
|---|
| … | … | |
| 81 | 81 | } |
|---|
| 82 | 82 | |
|---|
| 83 | | switch( p_sub->p_msg[i_start].i_object_type ) |
|---|
| 84 | | { |
|---|
| 85 | | case VLC_OBJECT_ROOT: psz_module_type = "root"; break; |
|---|
| 86 | | case VLC_OBJECT_VLC: psz_module_type = "vlc"; break; |
|---|
| 87 | | case VLC_OBJECT_MODULE: psz_module_type = "module"; break; |
|---|
| 88 | | case VLC_OBJECT_INTF: psz_module_type = "interface"; break; |
|---|
| 89 | | case VLC_OBJECT_PLAYLIST: psz_module_type = "playlist"; break; |
|---|
| 90 | | case VLC_OBJECT_ITEM: psz_module_type = "item"; break; |
|---|
| 91 | | case VLC_OBJECT_INPUT: psz_module_type = "input"; break; |
|---|
| 92 | | case VLC_OBJECT_DECODER: psz_module_type = "decoder"; break; |
|---|
| 93 | | case VLC_OBJECT_VOUT: psz_module_type = "video output"; break; |
|---|
| 94 | | case VLC_OBJECT_AOUT: psz_module_type = "audio output"; break; |
|---|
| 95 | | case VLC_OBJECT_SOUT: psz_module_type = "stream output"; break; |
|---|
| 96 | | } |
|---|
| | 83 | psz_module_type = p_sub->p_msg[i_start].psz_object_type; |
|---|
| 97 | 84 | |
|---|
| 98 | 85 | if( LockLooper() ) |
|---|
| re514383 |
r6c52c72 |
|
| 173 | 173 | msg = p_iter->p_messages->p_msg+i_pos; |
|---|
| 174 | 174 | buffer->i_severity = msg->i_type; |
|---|
| 175 | | buffer->psz_type = msg_GetObjectTypeName(msg->i_object_type); |
|---|
| | 175 | buffer->psz_type = msg->psz_object_type; |
|---|
| 176 | 176 | buffer->psz_name = msg->psz_module; |
|---|
| 177 | 177 | buffer->psz_header = msg->psz_header; |
|---|
| rc90b3db |
r6c52c72 |
|
| 174 | 174 | __msg_Generic |
|---|
| 175 | 175 | __msg_GenericVa |
|---|
| 176 | | msg_GetObjectTypeName |
|---|
| 177 | 176 | __msg_Info |
|---|
| 178 | 177 | __msg_Subscribe |
|---|
| rdfc2996 |
r6c52c72 |
|
| 198 | 198 | } |
|---|
| 199 | 199 | |
|---|
| 200 | | const char *msg_GetObjectTypeName(int i_object_type ) |
|---|
| 201 | | { |
|---|
| 202 | | switch( i_object_type ) |
|---|
| 203 | | { |
|---|
| 204 | | case VLC_OBJECT_GLOBAL: return "global"; |
|---|
| 205 | | case VLC_OBJECT_LIBVLC: return "libvlc"; |
|---|
| 206 | | case VLC_OBJECT_MODULE: return "module"; |
|---|
| 207 | | case VLC_OBJECT_INTF: return "interface"; |
|---|
| 208 | | case VLC_OBJECT_PLAYLIST: return "playlist"; |
|---|
| 209 | | case VLC_OBJECT_ITEM: return "item"; |
|---|
| 210 | | case VLC_OBJECT_INPUT: return "input"; |
|---|
| 211 | | case VLC_OBJECT_DECODER: return "decoder"; |
|---|
| 212 | | case VLC_OBJECT_PACKETIZER: return "packetizer"; |
|---|
| 213 | | case VLC_OBJECT_ENCODER: return "encoder"; |
|---|
| 214 | | case VLC_OBJECT_VOUT: return "video output"; |
|---|
| 215 | | case VLC_OBJECT_AOUT: return "audio output"; |
|---|
| 216 | | case VLC_OBJECT_SOUT: return "stream output"; |
|---|
| 217 | | case VLC_OBJECT_HTTPD: return "http server"; |
|---|
| 218 | | case VLC_OBJECT_HTTPD_HOST: return "http server"; |
|---|
| 219 | | case VLC_OBJECT_DIALOGS: return "dialogs provider"; |
|---|
| 220 | | case VLC_OBJECT_VLM: return "vlm"; |
|---|
| 221 | | case VLC_OBJECT_ANNOUNCE: return "announce handler"; |
|---|
| 222 | | case VLC_OBJECT_DEMUX: return "demuxer"; |
|---|
| 223 | | case VLC_OBJECT_ACCESS: return "access"; |
|---|
| 224 | | case VLC_OBJECT_META_ENGINE: return "meta engine"; |
|---|
| 225 | | default: return "private"; |
|---|
| 226 | | } |
|---|
| 227 | | } |
|---|
| 228 | | |
|---|
| 229 | 200 | /***************************************************************************** |
|---|
| 230 | 201 | * __msg_*: print a message |
|---|
| … | … | |
| 480 | 451 | p_item->i_type = VLC_MSG_WARN; |
|---|
| 481 | 452 | p_item->i_object_id = p_this->i_object_id; |
|---|
| 482 | | p_item->i_object_type = p_this->i_object_type; |
|---|
| | 453 | p_item->psz_object_type = p_this->psz_object_type; |
|---|
| 483 | 454 | p_item->psz_module = strdup( "message" ); |
|---|
| 484 | 455 | p_item->psz_msg = strdup( "message queue overflowed" ); |
|---|
| … | … | |
| 502 | 473 | p_item->i_type = i_type; |
|---|
| 503 | 474 | p_item->i_object_id = p_this->i_object_id; |
|---|
| 504 | | p_item->i_object_type = p_this->i_object_type; |
|---|
| | 475 | p_item->psz_object_type = p_this->psz_object_type; |
|---|
| 505 | 476 | p_item->psz_module = strdup( psz_module ); |
|---|
| 506 | 477 | p_item->psz_msg = psz_str; |
|---|
| … | … | |
| 604 | 575 | } |
|---|
| 605 | 576 | |
|---|
| 606 | | psz_object = msg_GetObjectTypeName(p_item->i_object_type); |
|---|
| | 577 | psz_object = p_item->psz_object_type; |
|---|
| 607 | 578 | |
|---|
| 608 | 579 | #ifdef UNDER_CE |
|---|