Commit f563132e authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas
Browse files

add method to set level using a qstring

parent c1664db5
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria. * Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Thu Mar 1 17:19:52 2012 (+0100) * Created: Thu Mar 1 17:19:52 2012 (+0100)
* Version: $Id$ * Version: $Id$
* Last-Updated: Wed Apr 4 10:23:59 2012 (+0200) * Last-Updated: mar. avril 24 15:04:50 2012 (+0200)
* By: tkloczko * By: Nicolas Niclausse
* Update #: 94 * Update #: 101
*/ */
/* Commentary: /* Commentary:
...@@ -38,6 +38,23 @@ void dtkLogger::setLevel(dtkLog::Level level) ...@@ -38,6 +38,23 @@ void dtkLogger::setLevel(dtkLog::Level level)
d->level = level; d->level = level;
} }
void dtkLogger::setLevel(QString level)
{
if (level == "trace")
d->level = dtkLog::Trace;
else if (level == "debug")
d->level = dtkLog::Debug;
else if (level == "info")
d->level = dtkLog::Info;
else if (level == "warn")
d->level = dtkLog::Warn;
else if (level == "error")
d->level = dtkLog::Error;
else if (level == "fatal")
d->level = dtkLog::Fatal;
}
void dtkLogger::attachConsole(void) void dtkLogger::attachConsole(void)
{ {
d->destinations << d->console; d->destinations << d->console;
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria. * Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Thu Mar 1 17:18:31 2012 (+0100) * Created: Thu Mar 1 17:18:31 2012 (+0100)
* Version: $Id$ * Version: $Id$
* Last-Updated: Wed Apr 4 10:03:36 2012 (+0200) * Last-Updated: mar. avril 24 15:02:52 2012 (+0200)
* By: tkloczko * By: Nicolas Niclausse
* Update #: 32 * Update #: 33
*/ */
/* Commentary: /* Commentary:
...@@ -40,6 +40,7 @@ public: ...@@ -40,6 +40,7 @@ public:
public: public:
void setLevel(dtkLog::Level level); void setLevel(dtkLog::Level level);
void setLevel(QString level);
public: public:
void attachConsole(void); void attachConsole(void);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment