Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
9eea072f
Commit
9eea072f
authored
Feb 22, 2016
by
Deomid Ryabkov
Committed by
rojer
Feb 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add optional log of timestamp difference
PUBLISHED_FROM=046ac695f1c771ab156bdd950a8d5cbecbf65bfa
parent
aa2ff674
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
mongoose.c
mongoose.c
+16
-0
mongoose.h
mongoose.h
+4
-0
No files found.
mongoose.c
View file @
9eea072f
...
...
@@ -339,6 +339,8 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst) {
#include <stdarg.h>
#include <stdio.h>
/* Amalgamated: #include "common/cs_time.h" */
enum
cs_log_level
s_cs_log_level
=
#ifdef CS_ENABLE_DEBUG
LL_VERBOSE_DEBUG
;
...
...
@@ -346,19 +348,33 @@ enum cs_log_level s_cs_log_level =
LL_ERROR
;
#endif
#ifdef CS_LOG_TS_DIFF
double
cs_log_ts
;
#endif
#ifndef CS_DISABLE_STDIO
void
cs_log_printf
(
const
char
*
fmt
,
...)
{
va_list
ap
;
#ifdef CS_LOG_TS_DIFF
double
now
=
cs_time
();
fprintf
(
stderr
,
"%7u "
,
(
unsigned
int
)
((
now
-
cs_log_ts
)
*
1000000
));
#endif
va_start
(
ap
,
fmt
);
vfprintf
(
stderr
,
fmt
,
ap
);
va_end
(
ap
);
fputc
(
'\n'
,
stderr
);
#ifdef CS_LOG_TS_DIFF
cs_log_ts
=
now
;
#endif
fflush
(
stderr
);
}
#endif
/* !CS_DISABLE_STDIO */
void
cs_log_set_level
(
enum
cs_log_level
level
)
{
s_cs_log_level
=
level
;
#ifdef CS_LOG_TS_DIFF
cs_log_ts
=
cs_time
();
#endif
}
#ifdef MG_MODULE_LINES
#line 0 "./src/../../common/cs_dirent.c"
...
...
mongoose.h
View file @
9eea072f
...
...
@@ -565,6 +565,10 @@ void cs_log_set_level(enum cs_log_level level);
#ifndef CS_DISABLE_STDIO
#ifdef CS_LOG_TS_DIFF
extern
double
cs_log_ts
;
#endif
void
cs_log_printf
(
const
char
*
fmt
,
...);
#define LOG(l, x) \
...
...
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