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
ece27ac9
Commit
ece27ac9
authored
Nov 22, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle
parent
a9dbfb8b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
14 deletions
+15
-14
example.cpp
example/example.cpp
+2
-2
common.h
include/spdlog/common.h
+2
-1
file_helper.h
include/spdlog/details/file_helper.h
+0
-0
file_sinks.h
include/spdlog/sinks/file_sinks.h
+0
-0
syslog_sink.h
include/spdlog/sinks/syslog_sink.h
+10
-10
spdlog.h
include/spdlog/spdlog.h
+1
-1
No files found.
example/example.cpp
View file @
ece27ac9
...
...
@@ -64,10 +64,10 @@ int main(int, char* [])
SPDLOG_TRACE
(
file_logger
,
"This is a trace message (only #ifdef _DEBUG)"
,
123
);
#ifdef __linux__
#ifdef __linux__
auto
syslog_logger
=
spd
::
syslog_logger
(
"syslog"
);
syslog_logger
->
warn
(
"This is warning that will end up in syslog. This is Linux only!"
);
#endif
#endif
}
catch
(
const
spd
::
spdlog_ex
&
ex
)
{
...
...
include/spdlog/common.h
View file @
ece27ac9
...
...
@@ -60,7 +60,8 @@ typedef enum
}
level_enum
;
static
const
char
*
level_names
[]
{
"trace"
,
"debug"
,
"info"
,
"notice"
,
"warning"
,
"error"
,
"critical"
,
"alert"
,
"emerg"
,
""
,
""
};
"alert"
,
"emerg"
,
""
,
""
};
inline
const
char
*
to_str
(
spdlog
::
level
::
level_enum
l
)
{
return
level_names
[
l
];
...
...
include/spdlog/details/file_helper.h
View file @
ece27ac9
include/spdlog/sinks/file_sinks.h
View file @
ece27ac9
include/spdlog/sinks/syslog_sink.h
View file @
ece27ac9
...
...
@@ -35,16 +35,16 @@
namespace
spdlog
{
namespace
sinks
{
/**
namespace
sinks
{
/**
* Sink that write to syslog using the `syscall()` library call.
*
* Locking is not needed, as `syslog()` itself is thread-safe.
*/
class
syslog_sink
:
public
sink
{
public
:
class
syslog_sink
:
public
sink
{
public
:
syslog_sink
()
{
_priorities
[
static_cast
<
int
>
(
level
::
TRACE
)]
=
LOG_DEBUG
;
...
...
@@ -70,7 +70,7 @@ namespace spdlog
syslog
(
syslog_prio_from_level
(
msg
),
"%s"
,
msg
.
formatted
.
str
().
c_str
());
};
protected
:
protected
:
/**
* Simply maps spdlog's log level to syslog priority level.
*/
...
...
@@ -79,10 +79,10 @@ namespace spdlog
return
_priorities
[
static_cast
<
int
>
(
msg
.
level
)];
}
private
:
private
:
std
::
array
<
int
,
11
>
_priorities
;
};
}
};
}
}
#endif
include/spdlog/spdlog.h
View file @
ece27ac9
...
...
@@ -70,7 +70,7 @@ std::shared_ptr<logger> stderr_logger_st(const std::string& logger_name);
// Create a syslog logger
#ifdef __linux__
std
::
shared_ptr
<
logger
>
syslog_logger
(
const
std
::
string
&
logger_name
);
std
::
shared_ptr
<
logger
>
syslog_logger
(
const
std
::
string
&
logger_name
);
#endif
...
...
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