mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Fixup debug output (#1617)
This commit is contained in:
parent
be4d388813
commit
3222de6c9c
17 changed files with 1451 additions and 630 deletions
46
src/config_log_file.cpp
Normal file
46
src/config_log_file.cpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2021, Antonio SJ Musumeci <trapexit@spawn.link>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config_log_file.hpp"
|
||||
|
||||
#include "debug.hpp"
|
||||
#include "fuse_cfg.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
LogFile::LogFile(const std::string &s_)
|
||||
{
|
||||
fuse_debug_set_output(s_);
|
||||
}
|
||||
|
||||
std::string
|
||||
LogFile::to_string(void) const
|
||||
{
|
||||
auto filepath = fuse_cfg.log_filepath();
|
||||
|
||||
return (filepath ? *filepath : "");
|
||||
}
|
||||
|
||||
int
|
||||
LogFile::from_string(const std::string_view s_)
|
||||
{
|
||||
const std::string s{s_};
|
||||
|
||||
return fuse_debug_set_output(s);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue