Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
json-schema-validator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IOPSYS
json-schema-validator
Commits
66d61154
Commit
66d61154
authored
5 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
add debug src and header
parent
f343ca98
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
src/debug.cpp
+21
-0
21 additions, 0 deletions
src/debug.cpp
src/debug.h
+19
-0
19 additions, 0 deletions
src/debug.h
with
40 additions
and
0 deletions
src/debug.cpp
0 → 100644
+
21
−
0
View file @
66d61154
extern
"C"
{
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdarg.h>
}
#include
"debug.h"
void
log_message
(
int
level
,
const
char
*
fmt
,
...)
{
va_list
args
;
/** TODO: properly implement debug levels
* if (iop_debug < level)
* return;
*/
va_start
(
args
,
fmt
);
vfprintf
(
stderr
,
fmt
,
args
);
va_end
(
args
);
}
This diff is collapsed.
Click to expand it.
src/debug.h
0 → 100644
+
19
−
0
View file @
66d61154
#ifndef DEBUG_H
#define DEBUG_H
#ifdef JSON_VALIDATOR_DEBUG
void
log_message
(
int
level
,
const
char
*
fmt
,
...);
#define err(...) log_message(0, __VA_ARGS__)
#define warn(...) log_message(1, __VA_ARGS__)
#define info(...) log_message(2, __VA_ARGS__)
#define dbg(...) log_message(3, __VA_ARGS__)
#else
#define err(...)
#define warn(...)
#define info(...)
#define dbg(...)
#endif
#endif
/* DEBUG_H */
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