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
79e8d77e
Commit
79e8d77e
authored
Nov 19, 2015
by
Deomid Ryabkov
Committed by
Sergey Lyubka
Nov 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shave the debug yak
PUBLISHED_FROM=402d26b6a2797bfe9fb70e48cbde97f3960ef5d4
parent
d68fab9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
9 deletions
+50
-9
mongoose.c
mongoose.c
+14
-1
mongoose.h
mongoose.h
+36
-8
No files found.
mongoose.c
View file @
79e8d77e
...
...
@@ -317,10 +317,19 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst) {
#line 1 "src/../../common/cs_dbg.c"
/**/
#endif
/* Amalgamated: #include "cs_dbg.h" */
#include <stdarg.h>
#include <stdio.h>
void
cs_dbg_printf
(
const
char
*
fmt
,
...)
{
enum
cs_log_level
s_cs_log_level
=
#ifdef CS_ENABLE_DEBUG
LL_DEBUG
;
#else
LL_ERROR
;
#endif
void
cs_log_printf
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
vfprintf
(
stderr
,
fmt
,
ap
);
...
...
@@ -328,6 +337,10 @@ void cs_dbg_printf(const char *fmt, ...) {
fputc
(
'\n'
,
stderr
);
fflush
(
stderr
);
}
void
cs_log_set_level
(
enum
cs_log_level
level
)
{
s_cs_log_level
=
level
;
}
#ifdef NS_MODULE_LINES
#line 1 "src/../../common/dirent.c"
/**/
...
...
mongoose.h
View file @
79e8d77e
...
...
@@ -106,6 +106,7 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
...
...
@@ -272,18 +273,41 @@ int64_t strtoll(const char *str, char **endptr, int base);
#ifndef _CS_DBG_H_
#define _CS_DBG_H_
#ifdef CS_ENABLE_DEBUG
enum
cs_log_level
{
LL_NONE
=
-
1
,
LL_ERROR
=
0
,
LL_WARN
=
1
,
LL_INFO
=
2
,
LL_DEBUG
=
3
,
void
cs_dbg_printf
(
const
char
*
fmt
,
...);
#define __DBG(x) \
do { \
_LL_MIN
=
-
2
,
_LL_MAX
=
4
,
};
#ifndef CS_NDEBUG
extern
enum
cs_log_level
s_cs_log_level
;
void
cs_log_set_level
(
enum
cs_log_level
level
);
void
cs_log_printf
(
const
char
*
fmt
,
...);
#define LOG(l, x) \
if (s_cs_log_level >= l) { \
fprintf(stderr, "%-20s ", __func__); \
cs_dbg_printf x; \
} while (0)
#define DBG __DBG
cs_log_printf x; \
}
#else
#define DBG(x) \
if (s_cs_log_level >= LL_DEBUG) { \
fprintf(stderr, "%-20s ", __func__); \
cs_log_printf x; \
}
#else
/* NDEBUG */
#define cs_log_set_level(l)
#define LOG(l, x)
#define DBG(x)
#endif
...
...
@@ -1327,8 +1351,12 @@ extern "C" {
#endif
#ifndef MG_MAX_PATH
#ifdef PATH_MAX
#define MG_MAX_PATH PATH_MAX
#else
#define MG_MAX_PATH 1024
#endif
#endif
#ifndef MG_MAX_HTTP_SEND_IOBUF
#define MG_MAX_HTTP_SEND_IOBUF 4096
...
...
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