Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
9e6d81de
Commit
9e6d81de
authored
Apr 25, 2017
by
Gabi Melman
Committed by
GitHub
Apr 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #422 from theamirocohen/android_log
Android_logger conditionally apply its own formatting
parents
8b11ffe1
45e3e704
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
android_sink.h
include/spdlog/sinks/android_sink.h
+4
-2
No files found.
include/spdlog/sinks/android_sink.h
View file @
9e6d81de
...
...
@@ -25,14 +25,15 @@ namespace sinks
class
android_sink
:
public
sink
{
public
:
explicit
android_sink
(
const
std
::
string
&
tag
=
"spdlog"
)
:
_tag
(
tag
)
{}
explicit
android_sink
(
const
std
::
string
&
tag
=
"spdlog"
,
bool
use_raw_msg
=
false
)
:
_tag
(
tag
),
_use_raw_msg
(
use_raw_msg
)
{}
void
log
(
const
details
::
log_msg
&
msg
)
override
{
const
android_LogPriority
priority
=
convert_to_android
(
msg
.
level
);
const
char
*
msg_output
=
(
_use_raw_msg
?
msg
.
raw
.
c_str
()
:
msg
.
formatted
.
c_str
());
// See system/core/liblog/logger_write.c for explanation of return value
const
int
ret
=
__android_log_write
(
priority
,
_tag
.
c_str
(),
msg
.
formatted
.
c_str
()
priority
,
_tag
.
c_str
(),
msg
_output
);
if
(
ret
<
0
)
{
...
...
@@ -67,6 +68,7 @@ private:
}
std
::
string
_tag
;
bool
_use_raw_msg
;
};
}
...
...
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