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
375b88c1
Commit
375b88c1
authored
Dec 18, 2014
by
fooinha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optional arguments for syslog_logger factory.
parent
309fca8a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
20 deletions
+32
-20
common.h
include/spdlog/common.h
+29
-0
spdlog_impl.h
include/spdlog/details/spdlog_impl.h
+1
-2
syslog_sink.h
include/spdlog/sinks/syslog_sink.h
+0
-17
spdlog.h
include/spdlog/spdlog.h
+2
-1
No files found.
include/spdlog/common.h
View file @
375b88c1
...
...
@@ -27,13 +27,42 @@
#include<initializer_list>
#include<chrono>
#ifdef __linux__
#define SYSLOG_NAMES 1
#include <syslog.h>
#endif
namespace
spdlog
{
class
formatter
;
namespace
sinks
{
class
sink
;
#ifdef __linux__
namespace
syslog
{
namespace
option
{
typedef
enum
{
CONS
=
LOG_CONS
,
NDELAY
=
LOG_NDELAY
,
NOWAIT
=
LOG_NOWAIT
,
ODELAY
=
LOG_ODELAY
,
PERROR
=
LOG_PERROR
,
PID
=
LOG_PID
}
option_enum
;
}
}
#endif
}
// Common types across the lib
using
log_clock
=
std
::
chrono
::
system_clock
;
...
...
include/spdlog/details/spdlog_impl.h
View file @
375b88c1
...
...
@@ -87,11 +87,10 @@ inline std::shared_ptr<spdlog::logger> spdlog::stderr_logger_st(const std::strin
#ifdef __linux__
// Create syslog logger
inline
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
ident
,
int
option
,
const
std
::
string
&
facility
)
inline
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
ident
,
int
option
,
const
std
::
string
&
facility
)
{
return
create
<
spdlog
::
sinks
::
syslog_sink
>
(
logger_name
,
ident
,
option
,
facility
);
}
#endif
...
...
include/spdlog/sinks/syslog_sink.h
View file @
375b88c1
...
...
@@ -28,9 +28,7 @@
#include <string>
#define SYSLOG_NAMES 1
#include <syslog.h>
#include "./sink.h"
#include "../common.h"
#include "../details/log_msg.h"
...
...
@@ -40,21 +38,6 @@ namespace spdlog
{
namespace
sinks
{
namespace
syslog
{
namespace
option
{
typedef
enum
{
CONS
=
LOG_CONS
,
NDELAY
=
LOG_NDELAY
,
NOWAIT
=
LOG_NOWAIT
,
ODELAY
=
LOG_ODELAY
,
PERROR
=
LOG_PERROR
,
PID
=
LOG_PID
}
option_enum
;
}
}
/**
* Sink that write to syslog using the `syscall()` library call.
*
...
...
include/spdlog/spdlog.h
View file @
375b88c1
...
...
@@ -96,7 +96,8 @@ 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
,
const
std
::
string
&
ident
,
int
option
,
const
std
::
string
&
facility
);
std
::
shared_ptr
<
logger
>
syslog_logger
(
const
std
::
string
&
logger_name
,
const
std
::
string
&
ident
=
""
,
int
option
=
static_cast
<
int
>
(
sinks
::
syslog
::
option
::
PID
),
const
std
::
string
&
facility
=
"user"
);
#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