Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c3cc1221
Commit
c3cc1221
authored
Oct 12, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logger: don't reinvent stdio, kill a few relocations
parent
83aac075
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
modules/misc/logger.c
modules/misc/logger.c
+24
-24
No files found.
modules/misc/logger.c
View file @
c3cc1221
...
...
@@ -52,8 +52,6 @@
#define LOG_FILE_TEXT "vlc-log.txt"
#define LOG_FILE_HTML "vlc-log.html"
#define LOG_STRING( msg, file ) fwrite( msg, strlen( msg ), 1, file );
#define TEXT_HEADER "-- logger module started --\n"
#define TEXT_FOOTER "-- logger module stopped --\n"
...
...
@@ -238,18 +236,18 @@ static int Open( vlc_object_t *p_this )
free
(
psz_file
);
return
-
1
;
}
setvbuf
(
p_
intf
->
p_
sys
->
p_file
,
NULL
,
_IONBF
,
0
);
setvbuf
(
p_sys
->
p_file
,
NULL
,
_IONBF
,
0
);
free
(
psz_file
);
switch
(
p_
intf
->
p_
sys
->
i_mode
)
switch
(
p_sys
->
i_mode
)
{
case
MODE_HTML
:
LOG_STRING
(
HTML_HEADER
,
p_sys
->
p_file
);
fputs
(
HTML_HEADER
,
p_sys
->
p_file
);
break
;
case
MODE_TEXT
:
default:
LOG_STRING
(
TEXT_HEADER
,
p_sys
->
p_file
);
fputs
(
TEXT_HEADER
,
p_sys
->
p_file
);
break
;
}
...
...
@@ -307,7 +305,7 @@ static void Close( vlc_object_t *p_this )
switch
(
p_sys
->
i_mode
)
{
case
MODE_HTML
:
LOG_STRING
(
HTML_FOOTER
,
p_sys
->
p_file
);
fputs
(
HTML_FOOTER
,
p_sys
->
p_file
);
break
;
#ifdef HAVE_SYSLOG_H
case
MODE_SYSLOG
:
...
...
@@ -316,7 +314,7 @@ static void Close( vlc_object_t *p_this )
#endif
case
MODE_TEXT
:
default:
LOG_STRING
(
TEXT_FOOTER
,
p_sys
->
p_file
);
fputs
(
TEXT_FOOTER
,
p_sys
->
p_file
);
break
;
}
...
...
@@ -401,15 +399,17 @@ static void FlushQueue( msg_subscription_t *p_sub, FILE *p_file, int i_mode,
}
}
static
const
char
*
ppsz_type
[
4
]
=
{
": "
,
" error: "
,
" warning: "
,
" debug: "
};
static
const
char
ppsz_type
[
4
][
11
]
=
{
": "
,
" error: "
,
" warning: "
,
" debug: "
,
};
static
void
TextPrint
(
const
msg_item_t
*
p_msg
,
FILE
*
p_file
)
{
LOG_STRING
(
p_msg
->
psz_module
,
p_file
);
LOG_STRING
(
ppsz_type
[
p_msg
->
i_type
],
p_file
);
LOG_STRING
(
p_msg
->
psz_msg
,
p_file
);
LOG_STRING
(
"
\n
"
,
p_file
);
fprintf
(
p_file
,
"%s%s%s
\n
"
,
p_msg
->
psz_module
,
ppsz_type
[
p_msg
->
i_type
],
p_msg
->
psz_msg
);
}
#ifdef HAVE_SYSLOG_H
...
...
@@ -431,16 +431,16 @@ static void SyslogPrint( const msg_item_t *p_msg )
static
void
HtmlPrint
(
const
msg_item_t
*
p_msg
,
FILE
*
p_file
)
{
static
const
char
*
ppsz_color
[
4
]
=
{
"<span style=
\"
color: #ffffff
\"
>"
,
"<span style=
\"
color: #ff6666
\"
>"
,
"<span style=
\"
color: #ffff
66
\"
>"
,
"<span style=
\"
color: #aaaaaa
\"
>"
};
LOG_STRING
(
p_msg
->
psz_module
,
p_file
)
;
LOG_STRING
(
ppsz_type
[
p_msg
->
i_type
],
p_file
);
LOG_STRING
(
ppsz_color
[
p_msg
->
i_type
],
p_file
);
LOG_STRING
(
p_msg
->
psz_msg
,
p_file
);
LOG_STRING
(
"</span>
\n
"
,
p_file
);
static
const
char
ppsz_color
[
4
][
30
]
=
{
"<span style=
\"
color: #ffffff
\"
>"
,
"<span style=
\"
color: #ff66
66
\"
>"
,
"<span style=
\"
color: #ffff66
\"
>"
,
"<span style=
\"
color: #aaaaaa
\"
>"
,
}
;
fprintf
(
p_file
,
"%s%s%s%s</span>
\n
"
,
p_msg
->
psz_module
,
ppsz_type
[
p_msg
->
i_type
],
ppsz_color
[
p_msg
->
i_type
],
p_msg
->
psz_msg
);
}
static
void
*
DoRRD
(
void
*
data
)
...
...
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