diff --git a/Utils/Console/Executor.cc b/Utils/Console/Executor.cc index a228c331b3a48537683bebe2002dc92797da0287..7733e072948b8b025cb0f702533932347d055628 100644 --- a/Utils/Console/Executor.cc +++ b/Utils/Console/Executor.cc @@ -96,7 +96,7 @@ prefix_ void senf::console::Executor::execute(std::ostream & output, break; try { // The parser ensures, we have exactly one argument - cd(*command.arguments().begin()); + cd(command.commandPath()); } catch (IgnoreCommandException &) { throw SyntaxErrorException( @@ -108,13 +108,15 @@ prefix_ void senf::console::Executor::execute(std::ostream & output, if (skipping()) break; // The parser ensures, we have either one or no argument - ls( output, - command.tokens().empty() ? command.tokens() : *command.arguments().begin() ); + ls( output, command.commandPath() ); break; case ParseCommandInfo::BuiltinPUSHD : // The parser ensures, we have exactly one argument - pushd( *command.arguments().begin() ); + if (skipping()) + pushd(command.commandPath()); + else + exec(output, command); break; case ParseCommandInfo::BuiltinPOPD : @@ -133,8 +135,7 @@ prefix_ void senf::console::Executor::execute(std::ostream & output, if (skipping()) break; // The parser ensures, we have either one or no arguments - help( output, - command.tokens().empty() ? command.tokens() : *command.arguments().begin() ); + help( output, command.commandPath() ); break; } @@ -154,17 +155,45 @@ prefix_ void senf::console::Executor::execute(std::ostream & output, prefix_ void senf::console::Executor::exec(std::ostream & output, ParseCommandInfo const & command) { - GenericNode & node ( traverseNode(command.commandPath()) ); - DirectoryNode * dir ( dynamic_cast<DirectoryNode*>(&node) ); - if ( dir ) { - if (autocd_ && command.tokens().empty()) { - cd( boost::make_iterator_range( - command.commandPath().begin(), - command.commandPath().end()) ); - } else - throw InvalidCommandException(); - } else { - dynamic_cast<CommandNode &>(node)(output, command); + try { + GenericNode & node ( traverseNode(command.commandPath()) ); + DirectoryNode * dir ( dynamic_cast<DirectoryNode*>(&node) ); + if ( dir ) { + if (! command.tokens().empty()) + throw InvalidCommandException(); + if (command.builtin() == ParseCommandInfo::BuiltinPUSHD) + pushd( command.commandPath() ); + else if (autocd_) { + cd(command.commandPath()); + } + else + throw InvalidCommandException(); + } else { + boost::any rv; + dynamic_cast<CommandNode &>(node)(rv, output, command); + if (command.builtin() == ParseCommandInfo::BuiltinPUSHD) { + DirectoryNode::ptr rvdir; + try { + rvdir = boost::any_cast<DirectoryNode::ptr>(rv); + } + catch (boost::bad_any_cast &) { + throw InvalidCommandException(); + } + Path newDir (cwd_); + newDir.push_back(rvdir); + dirstack_.push_back(Path()); + dirstack_.back().swap(cwd_); + cwd_.swap(newDir); + } + } + } + catch (IgnoreCommandException &) { + if (command.builtin() == ParseCommandInfo::BuiltinPUSHD) { + dirstack_.push_back(Path()); + dirstack_.back().swap(cwd_); + } + else + throw; } } @@ -320,6 +349,15 @@ prefix_ std::string senf::console::Executor::complete(DirectoryNode & dir, return name; } +prefix_ void senf::console::senf_console_format_value(DirectoryNode::ptr value, + std::ostream & os) +{ + if (value) + os << "<Directory at '" << value->path() << "'>"; + else + os << "<Null Directory>"; +} + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ //#include "Executor.mpp" diff --git a/Utils/Console/Executor.hh b/Utils/Console/Executor.hh index 7538eff228fd9e68e788bd73515396149323c351..540472d02ba5d3221313558f6c4e5daf2875c989 100644 --- a/Utils/Console/Executor.hh +++ b/Utils/Console/Executor.hh @@ -163,6 +163,8 @@ namespace console { bool autocomplete_; }; + void senf_console_format_value(DirectoryNode::ptr value, std::ostream & os); + }} ///////////////////////////////hh.e//////////////////////////////////////// diff --git a/Utils/Console/Node.cc b/Utils/Console/Node.cc index 39c26859d46d9f11f14c7ceca344cd64f92634c2..5096ba8edff342cbcabb799d93b18bd0218a8058 100644 --- a/Utils/Console/Node.cc +++ b/Utils/Console/Node.cc @@ -209,11 +209,11 @@ prefix_ void senf::console::SimpleCommandNode::v_help(std::ostream & output) output << doc_ << "\n"; } -prefix_ void senf::console::SimpleCommandNode::v_execute(std::ostream & output, +prefix_ void senf::console::SimpleCommandNode::v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) const { - fn_(output, command); + fn_(os, command); } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/Utils/Console/Node.cci b/Utils/Console/Node.cci index 1c130cbdf29692610ebfb03a078398d4066ec4ec..3c21bc95b60ce7fd2f3f63fcbaa48bcbd7ed410a 100644 --- a/Utils/Console/Node.cci +++ b/Utils/Console/Node.cci @@ -282,7 +282,16 @@ prefix_ void senf::console::CommandNode::execute(std::ostream & output, ParseCommandInfo const & command) const { - v_execute(output, command); + boost::any rv; + execute(rv, output, command); +} + +prefix_ void senf::console::CommandNode::execute(boost::any & rv, std::ostream & output, + ParseCommandInfo const & command) + const +{ + rv = boost::any(); + v_execute(rv, output, command); } prefix_ void senf::console::CommandNode::operator()(std::ostream & output, @@ -292,6 +301,13 @@ prefix_ void senf::console::CommandNode::operator()(std::ostream & output, execute(output, command); } +prefix_ void senf::console::CommandNode::operator()(boost::any & rv, std::ostream & output, + ParseCommandInfo const & command) + const +{ + execute(rv, output, command); +} + /////////////////////////////////////////////////////////////////////////// // senf::console::SimpleCommandNode diff --git a/Utils/Console/Node.hh b/Utils/Console/Node.hh index 6caef96215d5a9c40b1f3e9e39978b532fcbe2df..0367f5a872aa56a0db636a908cca829a1fd6517b 100644 --- a/Utils/Console/Node.hh +++ b/Utils/Console/Node.hh @@ -206,6 +206,7 @@ #include <boost/range/iterator_range.hpp> #include <boost/typeof/typeof.hpp> #include <boost/type_traits/remove_reference.hpp> +#include <boost/any.hpp> #include "../../Utils/Exception.hh" #include "../../Utils/mpl.hh" #include "../../Utils/Logger/SenfLog.hh" @@ -606,7 +607,15 @@ namespace console { void execute(std::ostream & output, ParseCommandInfo const & command) const; ///< Execute the command - /**< Same as operator()() + /**< \param[in] output stream where result messages may be + written to + \param[in] arguments command arguments. This is a + range of ranges of Token instances. */ + + void execute(boost::any & rv, std::ostream & output, ParseCommandInfo const & command) + const; + ///< Execute the command + /**< \param[out] rv command return value \param[in] output stream where result messages may be written to \param[in] arguments command arguments. This is a @@ -619,6 +628,8 @@ namespace console { written to \param[in] arguments command arguments. This is a range of ranges of Token instances. */ + void operator()(boost::any & rv, std::ostream & output, ParseCommandInfo const & command) + const; ptr thisptr(); cptr thisptr() const; @@ -629,10 +640,10 @@ namespace console { #ifndef DOXYGEN private: #endif - virtual void v_execute(std::ostream & output, ParseCommandInfo const & command) const = 0; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const = 0; ///< Called to execute the command - /**< \param[in] output stream where result messages may be - written to + /**< \param[out] rv return value holder \param[in] arguments command arguments. This is a range of ranges of Token instances. */ @@ -686,7 +697,8 @@ namespace console { private: virtual void v_help(std::ostream & output) const; - virtual void v_execute(std::ostream & output, ParseCommandInfo const & command) const; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const; Function fn_; diff --git a/Utils/Console/OverloadedCommand.cc b/Utils/Console/OverloadedCommand.cc index ecc5c44488cc81d72ed4369e5ea83754094b01c6..abae95e9256f6d9efd0fe8579d4b1c10a94d4d9c 100644 --- a/Utils/Console/OverloadedCommand.cc +++ b/Utils/Console/OverloadedCommand.cc @@ -155,7 +155,8 @@ prefix_ void senf::console::OverloadedCommandNode::v_help(std::ostream & os) } } -prefix_ void senf::console::OverloadedCommandNode::v_execute(std::ostream & output, +prefix_ void senf::console::OverloadedCommandNode::v_execute(boost::any & rv, + std::ostream & os, ParseCommandInfo const & command) const { @@ -164,7 +165,7 @@ prefix_ void senf::console::OverloadedCommandNode::v_execute(std::ostream & outp SyntaxErrorException err; for (; i != i_end; ++i) { try { - (**i)(output, command); + (**i)(rv, os, command); return; } catch (SyntaxErrorException & ex) { @@ -193,7 +194,8 @@ prefix_ std::string senf::console::SimpleCommandOverload::v_doc() return doc_; } -prefix_ void senf::console::SimpleCommandOverload::v_execute(std::ostream & os, +prefix_ void senf::console::SimpleCommandOverload::v_execute(boost::any & rv, + std::ostream & os, ParseCommandInfo const & command) const { diff --git a/Utils/Console/OverloadedCommand.cci b/Utils/Console/OverloadedCommand.cci index d48d9d69ae0f6280c868de909c73c84de4c53bef..c2fbdc6c26da6062869f1670322c09fe75b1da9b 100644 --- a/Utils/Console/OverloadedCommand.cci +++ b/Utils/Console/OverloadedCommand.cci @@ -72,16 +72,16 @@ prefix_ senf::console::OverloadedCommandNode::OverloadedCommandNode() prefix_ senf::console::CommandOverload::~CommandOverload() {} -prefix_ void senf::console::CommandOverload::execute(std::ostream & os, +prefix_ void senf::console::CommandOverload::execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) { - v_execute(os, command); + v_execute(rv, os, command); } -prefix_ void senf::console::CommandOverload::operator()(std::ostream & os, +prefix_ void senf::console::CommandOverload::operator()(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) { - execute(os, command); + execute(rv, os, command); } prefix_ unsigned senf::console::CommandOverload::numArguments() diff --git a/Utils/Console/OverloadedCommand.hh b/Utils/Console/OverloadedCommand.hh index ee9bde99f8e48381f11eb9773666e50e188a5f79..bb80f2332eef138fc2d8d276b521e7dd62d2f535 100644 --- a/Utils/Console/OverloadedCommand.hh +++ b/Utils/Console/OverloadedCommand.hh @@ -69,13 +69,13 @@ namespace console { virtual ~CommandOverload(); - void execute(std::ostream & os, ParseCommandInfo const & command); + void execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command); ///< Call the overload /**< If the \a arguments are not acceptable for this overload, a SyntaxErrorException must be thrown. Same as operator()() */ - void operator()(std::ostream & os, ParseCommandInfo const & command); + void operator()(boost::any & rv, std::ostream & os, ParseCommandInfo const & command); ///< Call the overload /**< If the \a arguments are not acceptable for this overload, a SyntaxErrorException must be thrown. @@ -120,7 +120,8 @@ namespace console { /**< This member must be implemented in the derived class to return the overloads documentation string. */ - virtual void v_execute(std::ostream & os, ParseCommandInfo const & command) const = 0; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const = 0; ///< Execute the overload /**< This member must be implemented in the derived class o execute the overload. */ @@ -196,7 +197,8 @@ namespace console { OverloadedCommandNode(); virtual void v_help(std::ostream & output) const; - virtual void v_execute(std::ostream & output, ParseCommandInfo const & command) const; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const; typedef std::vector<CommandOverload::ptr> Overloads; @@ -240,7 +242,8 @@ namespace console { virtual unsigned v_numArguments() const; virtual void v_argumentDoc(unsigned index, ArgumentDoc & doc) const; virtual std::string v_doc() const; - virtual void v_execute(std::ostream & os, ParseCommandInfo const & command) const; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const; Function fn_; std::string doc_; diff --git a/Utils/Console/Parse.cc b/Utils/Console/Parse.cc index e4e1e660f415b3b1ed425d4a02e938e63107f661..dece5df2982ed8052ec857f38b453f357cc26000 100644 --- a/Utils/Console/Parse.cc +++ b/Utils/Console/Parse.cc @@ -76,10 +76,10 @@ namespace detail { info_->builtin(ParseCommandInfo::BuiltinLS); setBuiltinPathArg(path); } - void pushDirectory(std::vector<Token> & path) - { info_->clear(); - info_->builtin(ParseCommandInfo::BuiltinPUSHD); - setBuiltinPathArg(path); } + void pushDirectory() + { // Do NOT call clear since pushDirectory is set in ADDITION + // to an ordinary command (which may be only a directory name) + info_->builtin(ParseCommandInfo::BuiltinPUSHD); } void popDirectory() { info_->clear(); @@ -96,11 +96,12 @@ namespace detail { void setBuiltinPathArg(std::vector<Token> & path) { - pushToken(ArgumentGroupOpenToken()); - for (std::vector<Token>::const_iterator i (path.begin()); - i != path.end(); ++i) - pushToken(*i); - pushToken(ArgumentGroupCloseToken()); + info_->command(path); +// pushToken(ArgumentGroupOpenToken()); +// for (std::vector<Token>::const_iterator i (path.begin()); +// i != path.end(); ++i) +// pushToken(*i); +// pushToken(ArgumentGroupCloseToken()); } }; @@ -249,7 +250,6 @@ namespace { void throwParserError(Error const & err) { static char const * msg [] = { "end of statement expected", - "'{' or arguments expected", "path expected", "')' expected", "'\"' expected" }; diff --git a/Utils/Console/Parse.cci b/Utils/Console/Parse.cci index 563cd6ffcbff4b2283440624da984523d32246c5..374d3660343add0e657d6b005d64df12f6624d45 100644 --- a/Utils/Console/Parse.cci +++ b/Utils/Console/Parse.cci @@ -178,7 +178,6 @@ prefix_ bool senf::console::ParseCommandInfo::empty() prefix_ void senf::console::ParseCommandInfo::builtin(BuiltinCommand builtin) { builtin_ = builtin; - commandPath_.clear(); } prefix_ void @@ -186,7 +185,6 @@ senf::console::ParseCommandInfo::command(std::vector<Token> & commandPath) { commandPath_.clear(); commandPath_.swap(commandPath); - builtin_ = NoBuiltin; } prefix_ void senf::console::ParseCommandInfo::addToken(Token const & token) diff --git a/Utils/Console/Parse.ih b/Utils/Console/Parse.ih index 8d3d35de6f496f955a54db49eee8bc2d44c2238d..38b9fc924edc073385e53fbff55e2514b2e4eb44 100644 --- a/Utils/Console/Parse.ih +++ b/Utils/Console/Parse.ih @@ -83,7 +83,6 @@ namespace detail { enum Errors { EndOfStatementExpected, - GroupOrArgumentsExpected, PathExpected, ClosingParenExpected, QuoteExpected @@ -145,7 +144,6 @@ namespace detail { actor< variable< ParseDispatcher > > d_ (self.dispatcher); assertion<Errors> end_of_statement_expected (EndOfStatementExpected); - assertion<Errors> group_or_arguments_expected (GroupOrArgumentsExpected); assertion<Errors> path_expected (PathExpected); assertion<Errors> closing_paren_expected (ClosingParenExpected); assertion<Errors> quote_expected (QuoteExpected); @@ -192,8 +190,16 @@ namespace detail { = builtin >> end_of_statement_expected(statement_end) | group_close | ch_p(';') // Ignore empty commands - | path_expected(path) - >> group_or_arguments_expected( group_start | statement ) + | statement + ; + + statement + = path_expected(path) [ bind(&PD::beginCommand)(d_, path_) ] + >> arguments + >> end_of_statement_expected( + ( group_start | statement_end ) + [ bind(&PD::endCommand)(d_) ] + ) ; builtin @@ -210,20 +216,13 @@ namespace detail { ; group_start - = ch_p('{') [ bind(&PD::pushDirectory)(d_, path_) ] + = ch_p('{') [ bind(&PD::pushDirectory)(d_) ] ; group_close = ch_p('}') [ bind(&PD::popDirectory)(d_) ] ; - statement - = eps_p [ bind(&PD::beginCommand)(d_, path_) ] - >> arguments - >> end_of_statement_expected(statement_end) - [ bind(&PD::endCommand)(d_) ] - ; - arguments = * argument ; diff --git a/Utils/Console/Parse.test.cc b/Utils/Console/Parse.test.cc index 4570fb0e61c706b49ee4a55d9cce22c90f563c5c..7b9e7beb8c945b61d8a3abc7397f1e6f57da05b7 100644 --- a/Utils/Console/Parse.test.cc +++ b/Utils/Console/Parse.test.cc @@ -49,8 +49,8 @@ namespace std::ostream & os_; - void pushDirectory(std::vector<senf::console::Token> const & path) - { os_ << "pushDirectory( " << senf::stringJoin(path, "/") << " )\n"; } + void pushDirectory() + { os_ << "pushDirectory()\n"; } void popDirectory() { os_ << "popDirectory()\n"; } @@ -154,7 +154,10 @@ BOOST_AUTO_UNIT_TEST(commandGrammar) "foo/bar/ {", grammar.use_parser<Grammar::CommandParser>(), grammar.use_parser<Grammar::SkipParser>() ) . full ); - BOOST_CHECK_EQUAL( ss.str(), "pushDirectory( Word('foo')/Word('bar')/None('') )\n" ); + BOOST_CHECK_EQUAL( ss.str(), + "beginCommand( Word('foo')/Word('bar')/None('') )\n" + "pushDirectory()\n" + "endCommand()\n" ); } { @@ -330,7 +333,7 @@ BOOST_AUTO_UNIT_TEST(parseExceptions) try { parser.parse(c, &setInfo); } \ catch (std::exception & ex) { msg = parseErrorMessage(ex.what()); } \ BOOST_CHECK_EQUAL( msg, e ) - + CheckParseEx( "/foo/bar;\n ()", "path expected\nat <unknown>:2:3" ); CheckParseEx( "cd /foo/bar foo/bar", "end of statement expected\nat <unknown>:1:13" ); CheckParseEx( "/foo/bar foo /", "end of statement expected\nat <unknown>:1:14" ); diff --git a/Utils/Console/ParsedCommand.mpp b/Utils/Console/ParsedCommand.mpp index a8598faff0748b06e1a638209556ef7f7fa45860..340e073bd676109926929ef97070baa64d5c7287 100644 --- a/Utils/Console/ParsedCommand.mpp +++ b/Utils/Console/ParsedCommand.mpp @@ -102,7 +102,8 @@ protected: private: ParsedCommandOverload(Function fn); - virtual void v_execute(std::ostream & os, ParseCommandInfo const & command) const; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const; Function function_; Formatter formatter_; @@ -140,7 +141,8 @@ protected: private: ParsedCommandOverload(Function fn); - virtual void v_execute(std::ostream & os, ParseCommandInfo const & command) const; + virtual void v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) + const; Function function_; }; @@ -249,7 +251,7 @@ ParsedCommandOverload(Function fn) template <class FunctionTraits, class ReturnValue> prefix_ void senf::console::ParsedCommandOverload<FunctionTraits, ReturnValue, BOOST_PP_ITERATION() >:: -v_execute(std::ostream & os, ParseCommandInfo const & command) +v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) const { // We NEED to know the number of arguments beforehand so we can assign default values @@ -280,16 +282,18 @@ v_execute(std::ostream & os, ParseCommandInfo const & command) # undef mpp_l # undef mpp_l_ + ReturnValue rvv (function_(os mpp_TrailingArgs())); + rv = rvv; if (formatter_) - formatter_( function_(os mpp_TrailingArgs()), os ); + formatter_(rvv, os); else - ReturnValueTraits<result_type>::format( function_(os mpp_TrailingArgs()), os ); + ReturnValueTraits<result_type>::format(rvv, os); os << "\n"; } template <class FunctionTraits> prefix_ void senf::console::ParsedCommandOverload<FunctionTraits, void, BOOST_PP_ITERATION() >:: -v_execute(std::ostream & os, ParseCommandInfo const & command) +v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command) const { // We NEED to know the number of arguments beforehand so we can assign default values diff --git a/Utils/Console/ParsedCommand.test.cc b/Utils/Console/ParsedCommand.test.cc index 0ad7fc66716d2465eadec71e7d3d5d51a861d21b..42a509799cd4c4c8da4a3bacb316e09213d53806 100644 --- a/Utils/Console/ParsedCommand.test.cc +++ b/Utils/Console/ParsedCommand.test.cc @@ -273,6 +273,36 @@ BOOST_AUTO_UNIT_TEST(memberParsedCommand) } } +namespace { + + senf::console::DirectoryNode::ptr dircb() + { + senf::console::DirectoryNode & dir ( + senf::console::root()["test"].mkdir("dircb")); + dir.add("cb1", &cb1); + return dir.thisptr(); + } + +} + +BOOST_AUTO_UNIT_TEST(directoryReturn) +{ + senf::console::Executor executor; + senf::console::CommandParser parser; + senf::console::ScopedDirectory<> dir; + senf::console::root().add("test", dir); + dir.add("test", &dircb); + + { + std::stringstream ss; + SENF_CHECK_NO_THROW( + parser.parse("test/test { ls; }", + boost::bind<void>( boost::ref(executor), boost::ref(ss), _1 )) ); + BOOST_CHECK_EQUAL( ss.str(), "<Directory at '/test/dircb'>\ncb1\n" ); + } + +} + #ifdef COMPILE_CHECK COMPILE_FAIL(argParser) diff --git a/Utils/Logger/FileTarget.cc b/Utils/Logger/FileTarget.cc index 7cc2ad064a44df55af765dff86800035a7fe915f..52ebaf82670003f024e0ea75c727ddbe5ca57e9a 100644 --- a/Utils/Logger/FileTarget.cc +++ b/Utils/Logger/FileTarget.cc @@ -71,10 +71,13 @@ prefix_ senf::log::FileTarget::RegisterConsole::RegisterConsole() .doc("Create new file target."); } -prefix_ void senf::log::FileTarget::RegisterConsole::create(std::string const & filename) +prefix_ boost::shared_ptr<senf::console::DirectoryNode> +senf::log::FileTarget::RegisterConsole::create(std::string const & filename) { - detail::TargetRegistry::instance().dynamicTarget( - std::auto_ptr<Target>(new FileTarget(filename))); + std::auto_ptr<Target> tp (new FileTarget(filename)); + Target & target (*tp.get()); + detail::TargetRegistry::instance().dynamicTarget(tp); + return target.consoleDir().node().thisptr(); } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/Utils/Logger/FileTarget.hh b/Utils/Logger/FileTarget.hh index ccd78fcbc3ad4a670e239b2b095b3825a4c93e6c..11543d74177ab35a4141117a9e2cbb08e2bc1fed 100644 --- a/Utils/Logger/FileTarget.hh +++ b/Utils/Logger/FileTarget.hh @@ -28,6 +28,7 @@ // Custom includes #include <boost/utility.hpp> +#include <boost/shared_ptr.hpp> #include <fstream> #include "IOStreamTarget.hh" @@ -35,6 +36,9 @@ ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { + + namespace console { class DirectoryNode; } + namespace log { /** \brief Log target writing to a %log file. @@ -79,7 +83,8 @@ namespace log { struct RegisterConsole { RegisterConsole(); - static void create(std::string const & filename); + static boost::shared_ptr<senf::console::DirectoryNode> create( + std::string const & filename); static RegisterConsole instance; }; }; diff --git a/Utils/Logger/Target.hh b/Utils/Logger/Target.hh index e371443f2eb48f692ebfc15b3d80d9a337fbf13f..6f26ddd7a4fda22b5f7a7e990a82fdce79d73e32 100644 --- a/Utils/Logger/Target.hh +++ b/Utils/Logger/Target.hh @@ -342,7 +342,6 @@ namespace log { void flush(); ///< Clear routing table - protected: senf::console::ScopedDirectory<> & consoleDir(); ///< Get console/config directory private: