Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mongoose
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
79e8d77e
Commit
79e8d77e
authored
9 years ago
by
Deomid Ryabkov
Committed by
Sergey Lyubka
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Shave the debug yak
PUBLISHED_FROM=402d26b6a2797bfe9fb70e48cbde97f3960ef5d4
parent
d68fab9e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mongoose.c
+14
-1
14 additions, 1 deletion
mongoose.c
mongoose.h
+36
-8
36 additions, 8 deletions
mongoose.h
with
50 additions
and
9 deletions
mongoose.c
+
14
−
1
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"
/**/
...
...
This diff is collapsed.
Click to expand it.
mongoose.h
+
36
−
8
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment