Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
fc908a6d
Commit
fc908a6d
authored
May 11, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split up debug message printing (more readable in my opinion)
parent
4f477ba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
src/misc/messages.c
src/misc/messages.c
+23
-20
No files found.
src/misc/messages.c
View file @
fc908a6d
...
@@ -435,9 +435,8 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
...
@@ -435,9 +435,8 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
# define WHITE COL(0,1)
# define WHITE COL(0,1)
# define GRAY "\033[0m"
# define GRAY "\033[0m"
static
const
char
ppsz_type
[
4
][
9
]
=
{
""
,
" error"
,
" warning"
,
" debug"
};
static
const
char
msgtype
[
4
][
9
]
=
{
""
,
" error"
,
" warning"
,
" debug"
};
static
const
char
ppsz_color
[
4
][
8
]
=
{
WHITE
,
RED
,
YELLOW
,
GRAY
};
static
const
char
msgcolor
[
4
][
8
]
=
{
WHITE
,
RED
,
YELLOW
,
GRAY
};
const
char
*
psz_object
;
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_this
->
p_libvlc
);
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_this
->
p_libvlc
);
msg_bank_t
*
bank
=
priv
->
msg_bank
;
msg_bank_t
*
bank
=
priv
->
msg_bank
;
int
i_type
=
p_item
->
i_type
;
int
i_type
=
p_item
->
i_type
;
...
@@ -458,7 +457,7 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
...
@@ -458,7 +457,7 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
break
;
break
;
}
}
psz_object
=
p_item
->
psz_object_type
;
const
char
*
objtype
=
p_item
->
psz_object_type
;
void
*
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
void
*
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
p_item
->
psz_module
);
p_item
->
psz_module
);
if
(
val
==
kObjectPrintingDisabled
)
if
(
val
==
kObjectPrintingDisabled
)
...
@@ -468,7 +467,7 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
...
@@ -468,7 +467,7 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
else
else
{
{
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
psz_object
);
objtype
);
if
(
val
==
kObjectPrintingDisabled
)
if
(
val
==
kObjectPrintingDisabled
)
return
;
return
;
if
(
val
==
kObjectPrintingEnabled
)
if
(
val
==
kObjectPrintingEnabled
)
...
@@ -477,22 +476,26 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
...
@@ -477,22 +476,26 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
return
;
return
;
}
}
int
canc
=
vlc_savecancel
();
/* Send the message to stderr */
/* Send the message to stderr */
utf8_fprintf
(
stderr
,
"[%s%p%s] %s%s%s %s%s: %s%s%s
\n
"
,
FILE
*
stream
=
stderr
;
priv
->
b_color
?
GREEN
:
""
,
int
canc
=
vlc_savecancel
();
(
void
*
)
p_item
->
i_object_id
,
priv
->
b_color
?
GRAY
:
""
,
flockfile
(
stream
);
p_item
->
psz_header
?
p_item
->
psz_header
:
""
,
fprintf
(
stream
,
priv
->
b_color
?
"["
GREEN
"%p"
GRAY
"] "
:
"[%p] "
,
p_item
->
psz_header
?
" "
:
""
,
(
void
*
)
p_item
->
i_object_id
);
p_item
->
psz_module
,
psz_object
,
if
(
p_item
->
psz_header
!=
NULL
)
ppsz_type
[
i_type
],
utf8_fprintf
(
stream
,
"%s "
,
p_item
->
psz_header
);
priv
->
b_color
?
ppsz_color
[
i_type
]
:
""
,
utf8_fprintf
(
stream
,
"%s %s%s: "
,
p_item
->
psz_module
,
objtype
,
p_item
->
psz_msg
,
msgtype
[
i_type
]);
priv
->
b_color
?
GRAY
:
""
);
if
(
priv
->
b_color
)
fputs
(
msgcolor
[
i_type
],
stream
);
#if defined( WIN32 ) || defined( __OS2__ )
fputs
(
p_item
->
psz_msg
,
stream
);
fflush
(
stderr
);
if
(
priv
->
b_color
)
fputs
(
GRAY
,
stream
);
putc_unlocked
(
'\n'
,
stream
);
#if defined (WIN32) || defined (__OS2__)
fflush
(
stream
);
#endif
#endif
funlockfile
(
stream
);
vlc_restorecancel
(
canc
);
vlc_restorecancel
(
canc
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment