forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support loading setting from config file and improve logging. (#118)
* support config load * fix building error * fix bugs * commit again * improve function params, std::string -> const std::string& * refinement configure loading * fixed code style Co-authored-by: lgbo-ustc <[email protected]>
- Loading branch information
1 parent
1eed312
commit e3b48c1
Showing
20 changed files
with
244 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
#include "Logger.h" | ||
|
||
#include <loggers/Loggers.h> | ||
#include <Poco/ConsoleChannel.h> | ||
#include <Poco/AutoPtr.h> | ||
#include <Poco/AsyncChannel.h> | ||
#include <Poco/SimpleFileChannel.h> | ||
|
||
|
||
using Poco::ConsoleChannel; | ||
using Poco::AutoPtr; | ||
using Poco::AsyncChannel; | ||
|
||
void local_engine::Logger::initConsoleLogger() | ||
void local_engine::Logger::initConsoleLogger(const std::string & level) | ||
{ | ||
AutoPtr<ConsoleChannel> pCons(new ConsoleChannel); | ||
AutoPtr<AsyncChannel> pAsync(new AsyncChannel(pCons)); | ||
Poco::Logger::root().setChannel(pAsync); | ||
Poco::Logger::root().setLevel("error"); | ||
Poco::Logger::root().debug("init logger success"); | ||
AutoPtr<ConsoleChannel> chan(new ConsoleChannel); | ||
AutoPtr<AsyncChannel> async_chann(new AsyncChannel(chan)); | ||
Poco::Logger::root().setChannel(async_chann); | ||
Poco::Logger::root().setLevel(level); | ||
} | ||
|
||
void local_engine::Logger::initFileLogger(Poco::Util::AbstractConfiguration & config, const std::string & cmd_name) | ||
{ | ||
static Loggers loggers; | ||
loggers.buildLoggers(config, Poco::Logger::root(), cmd_name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.