Browse Source

[trac756] Adapt to changed parameter order

Michal 'vorner' Vaner 14 years ago
parent
commit
f28bffcf3e
2 changed files with 8 additions and 8 deletions
  1. 5 5
      src/lib/python/isc/log/log.cc
  2. 3 3
      src/lib/python/isc/log/tests/log_test.py

+ 5 - 5
src/lib/python/isc/log/log.cc

@@ -147,12 +147,12 @@ init(PyObject*, PyObject* args) {
     const char* file(NULL);
     const char* severity("INFO");
     int dbglevel(0);
-    if (!PyArg_ParseTuple(args, "s|zsi", &root, &file, &severity, &dbglevel)) {
+    if (!PyArg_ParseTuple(args, "s|siz", &root, &severity, &dbglevel, &file)) {
         return (NULL);
     }
 
     try {
-        LoggerManager::init(root, file, getSeverity(severity), dbglevel);
+        LoggerManager::init(root, getSeverity(severity), dbglevel, file);
     }
     catch (const std::exception& e) {
         PyErr_SetString(PyExc_RuntimeError, e.what());
@@ -183,9 +183,9 @@ PyMethodDef methods[] = {
     {"init", init, METH_VARARGS,
         "Run-time initialization. You need to call this before you do any "
         "logging, to configure the root logger name. You may also provide "
-        "a filename with message translations (or None if you don't want "
-        "any), logging severity (one of 'DEBUG', 'INFO', 'WARN', 'ERROR' or "
-        "'FATAL') and a debug level (integer in the range 0-99)."},
+        "logging severity (one of 'DEBUG', 'INFO', 'WARN', 'ERROR' or "
+        "'FATAL'), a debug level (integer in the range 0-99) and a file name "
+        "of a dictionary with message text translations."},
     {NULL, NULL, 0, NULL}
 };
 

+ 3 - 3
src/lib/python/isc/log/tests/log_test.py

@@ -39,7 +39,7 @@ class Manager(unittest.TestCase):
         # We try calling it now only, as we don't have any other functions
         # to check the outcome by it. Once we add the logger class, we may
         # check more.
-        isc.log.init("root", None, "DEBUG", 50)
+        isc.log.init("root", "DEBUG", 50, None)
 
     def test_init_defaults(self):
         # We try calling it now only, as we don't have any other functions
@@ -50,14 +50,14 @@ class Manager(unittest.TestCase):
     def test_init_notfound(self):
         # This should not throw, because the C++ one doesn't. Should we really
         # ignore errors like missing file?
-        isc.log.init("root", "/no/such/file");
+        isc.log.init("root", "INFO", 0, "/no/such/file");
 
 class Logger(unittest.TestCase):
     def tearDown(self):
         isc.log.reset()
 
     def setUp(self):
-        isc.log.init("root", None, "DEBUG", 50)
+        isc.log.init("root", "DEBUG", 50)
         self.sevs = ['INFO', 'WARN', 'ERROR', 'FATAL']
 
     # Checks defaults of the logger