diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-08-11 23:41:26 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-08-12 01:47:32 +0100 |
commit | 31f61cdaa796957f703d3374ec5cec7e897fecbc (patch) | |
tree | 7dd56a6e221c5ee63cb56ae92d3638f0d64acafe /netfs/fuse | |
parent | Visibility hidden (diff) | |
download | netfs-31f61cdaa796957f703d3374ec5cec7e897fecbc.tar.bz2 netfs-31f61cdaa796957f703d3374ec5cec7e897fecbc.tar.xz netfs-31f61cdaa796957f703d3374ec5cec7e897fecbc.zip |
Write client logs to syslog instead of stderr (/dev/null)
Diffstat (limited to 'netfs/fuse')
-rw-r--r-- | netfs/fuse/Jamfile.jam | 4 | ||||
-rw-r--r-- | netfs/fuse/netfs.cpp | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/netfs/fuse/Jamfile.jam b/netfs/fuse/Jamfile.jam index 142221e..8413d1f 100644 --- a/netfs/fuse/Jamfile.jam +++ b/netfs/fuse/Jamfile.jam @@ -29,8 +29,11 @@ lib netfsClientConfiguration : <library>..//slicer ; +obj misc : ../../libmisc/misc.cpp ; + lib netfsClient : pch + misc netfsClientConfiguration [ glob *.cpp : netfs.cpp ] [ glob ../../libfusepp/fuse*.cpp ] @@ -66,6 +69,7 @@ lib netfsClient : ; exe netfs : + misc netfs.cpp : <library>netfsClient <library>fuse diff --git a/netfs/fuse/netfs.cpp b/netfs/fuse/netfs.cpp index 23996c2..945c599 100644 --- a/netfs/fuse/netfs.cpp +++ b/netfs/fuse/netfs.cpp @@ -1,8 +1,18 @@ #include "fuseApp.h" +#include <syslog.h> class FuseImpl : public NetFS::FuseApp { public: - FuseImpl(const Ice::StringSeq & a) : NetFS::FuseApp(a) { } + FuseImpl(const Ice::StringSeq & a) : + NetFS::FuseApp(a) + { + openlog("netfs", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER); + } + + ~FuseImpl() + { + closelog(); + } struct fuse_context * fuse_get_context() override { @@ -18,6 +28,11 @@ class FuseImpl : public NetFS::FuseApp { { return ::fuse_main(argc, argv, ops, this); } + + void log(int priority, const std::string & message) const throw() override + { + syslog(priority, "%s", message.c_str()); + } }; int |