Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
0cc48cfd
Commit
0cc48cfd
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
logger: move more symbols in jami namespace
Change-Id: I0fe99a8d44f8bc5271bea0b7b6a0e377f051f0ab
parent
e7ca4d29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/logger.cpp
+34
-34
34 additions, 34 deletions
src/logger.cpp
with
34 additions
and
34 deletions
src/logger.cpp
+
34
−
34
View file @
0cc48cfd
...
...
@@ -89,6 +89,40 @@
#define LOGFILE "jami"
static
const
char
*
check_error
(
int
result
,
char
*
buffer
)
{
switch
(
result
)
{
case
0
:
return
buffer
;
case
ERANGE
:
/* should never happen */
return
"unknown (too big to display)"
;
default:
return
"unknown (invalid error number)"
;
}
}
static
const
char
*
check_error
(
char
*
result
,
char
*
)
{
return
result
;
}
void
strErr
(
void
)
{
#ifdef __GLIBC__
JAMI_ERR
(
"%m"
);
#else
char
buf
[
1000
];
JAMI_ERR
(
"%s"
,
check_error
(
strerror_r
(
errno
,
buf
,
sizeof
(
buf
)),
buf
));
#endif
}
namespace
jami
{
static
constexpr
auto
ENDL
=
'\n'
;
// extract the last component of a pathname (extract a filename from its dirname)
...
...
@@ -172,40 +206,6 @@ contextHeader(const char* const file, int line)
return
out
.
str
();
}
static
const
char
*
check_error
(
int
result
,
char
*
buffer
)
{
switch
(
result
)
{
case
0
:
return
buffer
;
case
ERANGE
:
/* should never happen */
return
"unknown (too big to display)"
;
default:
return
"unknown (invalid error number)"
;
}
}
static
const
char
*
check_error
(
char
*
result
,
char
*
)
{
return
result
;
}
void
strErr
(
void
)
{
#ifdef __GLIBC__
JAMI_ERR
(
"%m"
);
#else
char
buf
[
1000
];
JAMI_ERR
(
"%s"
,
check_error
(
strerror_r
(
errno
,
buf
,
sizeof
(
buf
)),
buf
));
#endif
}
namespace
jami
{
struct
BufDeleter
{
void
operator
()(
char
*
ptr
)
...
...
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