-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
809a10a
commit 1afaa8b
Showing
23 changed files
with
339 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later | ||
* | ||
* Copyright (c) 2021, Olivier Martin <[email protected]> | ||
*/ | ||
|
||
#include "gattlib_internal.h" | ||
|
||
void gattlib_log(int level, const char *format, ...) { | ||
va_list args; | ||
FILE *stream = stdout; | ||
|
||
if (level == GATTLIB_ERROR) { | ||
stream = stderr; | ||
} | ||
|
||
va_start(args, format); | ||
vfprintf(stream, format, args); | ||
fprintf(stream, "\n"); | ||
va_end(args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later | ||
* | ||
* Copyright (c) 2021, Olivier Martin <[email protected]> | ||
*/ | ||
|
||
#include <syslog.h> | ||
|
||
#include "gattlib_internal.h" | ||
|
||
static const int m_gattlib_log_level_to_syslog[] = { | ||
LOG_ERR, LOG_WARNING, LOG_INFO, LOG_DEBUG | ||
}; | ||
|
||
void gattlib_log(int level, const char *format, ...) { | ||
va_list args; | ||
|
||
va_start(args, format); | ||
vsyslog(m_gattlib_log_level_to_syslog[level], format, args); | ||
va_end(args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.