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
2678c37b
Commit
2678c37b
authored
Aug 22, 2016
by
Nazım Can Bedir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move syslog support tests to one place.
parent
e556daeb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
5 deletions
+12
-5
example.cpp
example/example.cpp
+1
-1
common.h
include/spdlog/common.h
+6
-0
spdlog_impl.h
include/spdlog/details/spdlog_impl.h
+1
-1
syslog_sink.h
include/spdlog/sinks/syslog_sink.h
+3
-2
spdlog.h
include/spdlog/spdlog.h
+1
-1
No files found.
example/example.cpp
View file @
2678c37b
...
@@ -108,7 +108,7 @@ void async_example()
...
@@ -108,7 +108,7 @@ void async_example()
//syslog example (linux/osx/freebsd)
//syslog example (linux/osx/freebsd)
void
syslog_example
()
void
syslog_example
()
{
{
#if
defined (__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if
def SPDLOG_ENABLE_SYSLOG
std
::
string
ident
=
"spdlog-example"
;
std
::
string
ident
=
"spdlog-example"
;
auto
syslog_logger
=
spd
::
syslog_logger
(
"syslog"
,
ident
,
LOG_PID
);
auto
syslog_logger
=
spd
::
syslog_logger
(
"syslog"
,
ident
,
LOG_PID
);
syslog_logger
->
warn
(
"This is warning that will end up in syslog."
);
syslog_logger
->
warn
(
"This is warning that will end up in syslog."
);
...
...
include/spdlog/common.h
View file @
2678c37b
...
@@ -37,6 +37,12 @@
...
@@ -37,6 +37,12 @@
#define DEPRECATED
#define DEPRECATED
#endif
#endif
#ifndef SPDLOG_ENABLE_SYSLOG
#if defined (__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#define SPDLOG_ENABLE_SYSLOG
#endif
#endif
#include <spdlog/fmt/fmt.h>
#include <spdlog/fmt/fmt.h>
...
...
include/spdlog/details/spdlog_impl.h
View file @
2678c37b
...
@@ -96,7 +96,7 @@ inline std::shared_ptr<spdlog::logger> spdlog::stderr_logger_st(const std::strin
...
@@ -96,7 +96,7 @@ inline std::shared_ptr<spdlog::logger> spdlog::stderr_logger_st(const std::strin
return
create_console_logger
(
logger_name
,
sinks
::
stderr_sink_st
::
instance
(),
color
);
return
create_console_logger
(
logger_name
,
sinks
::
stderr_sink_st
::
instance
(),
color
);
}
}
#if
defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if
def SPDLOG_ENABLE_SYSLOG
// Create syslog logger
// Create syslog logger
inline
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
syslog_ident
,
int
syslog_option
)
inline
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
syslog_ident
,
int
syslog_option
)
{
{
...
...
include/spdlog/sinks/syslog_sink.h
View file @
2678c37b
...
@@ -5,10 +5,11 @@
...
@@ -5,10 +5,11 @@
#pragma once
#pragma once
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <spdlog/common.h>
#ifdef SPDLOG_ENABLE_SYSLOG
#include <spdlog/sinks/sink.h>
#include <spdlog/sinks/sink.h>
#include <spdlog/common.h>
#include <spdlog/details/log_msg.h>
#include <spdlog/details/log_msg.h>
#include <array>
#include <array>
...
...
include/spdlog/spdlog.h
View file @
2678c37b
...
@@ -98,7 +98,7 @@ std::shared_ptr<logger> stderr_logger_st(const std::string& logger_name, bool co
...
@@ -98,7 +98,7 @@ std::shared_ptr<logger> stderr_logger_st(const std::string& logger_name, bool co
//
//
// Create and register a syslog logger
// Create and register a syslog logger
//
//
#if
defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if
def SPDLOG_ENABLE_SYSLOG
std
::
shared_ptr
<
logger
>
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
ident
=
""
,
int
syslog_option
=
0
);
std
::
shared_ptr
<
logger
>
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
ident
=
""
,
int
syslog_option
=
0
);
#endif
#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