aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/mlog.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-04 12:43:19 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-04 12:43:19 +0000
commitcbdfa7576ae5b58136363d7639f6a52092838084 (patch)
treebd7ca1f8c03d5bdee50c6c6f9b8219c3f863ff3b /contrib/epee/src/mlog.cpp
parentMerge pull request #1663 (diff)
downloadmonero-cbdfa7576ae5b58136363d7639f6a52092838084.tar.xz
mlog: fix default logging being not verbose enough
Diffstat (limited to 'contrib/epee/src/mlog.cpp')
-rw-r--r--contrib/epee/src/mlog.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/contrib/epee/src/mlog.cpp b/contrib/epee/src/mlog.cpp
index 139e7b7d6..9266f1891 100644
--- a/contrib/epee/src/mlog.cpp
+++ b/contrib/epee/src/mlog.cpp
@@ -77,6 +77,32 @@ static void mlog_set_common_prefix()
el::Loggers::setFilenameCommonPrefix(std::string(path, expected_ptr - path));
}
+static const char *get_default_categories(int level)
+{
+ const char *categories = "";
+ switch (level)
+ {
+ case 0:
+ categories = "*:WARNING,net*:FATAL,global:INFO,verify:FATAL,stacktrace:INFO";
+ break;
+ case 1:
+ categories = "*:WARNING,global:INFO,stacktrace:INFO";
+ break;
+ case 2:
+ categories = "*:DEBUG";
+ break;
+ case 3:
+ categories = "*:TRACE";
+ break;
+ case 4:
+ categories = "*:TRACE";
+ break;
+ default:
+ break;
+ }
+ return categories;
+}
+
void mlog_configure(const std::string &filename_base, bool console)
{
el::Configurations c;
@@ -103,37 +129,11 @@ void mlog_configure(const std::string &filename_base, bool console)
const char *monero_log = getenv("MONERO_LOGS");
if (!monero_log)
{
- monero_log = "*:WARNING,net*:FATAL,global:INFO,verify:FATAL";
+ monero_log = get_default_categories(0);
}
mlog_set_categories(monero_log);
}
-static const char *get_default_categories(int level)
-{
- const char *categories = "";
- switch (level)
- {
- case 0:
- categories = "*:FATAL,net*:FATAL,global:INFO,verify:FATAL,stacktrace:INFO";
- break;
- case 1:
- categories = "*:WARNING,global:INFO,stacktrace:INFO";
- break;
- case 2:
- categories = "*:DEBUG";
- break;
- case 3:
- categories = "*:TRACE";
- break;
- case 4:
- categories = "*:TRACE";
- break;
- default:
- break;
- }
- return categories;
-}
-
void mlog_set_categories(const char *categories)
{
el::Loggers::setCategories(categories);