Browse Source

[2637] Use logger to issue the warning about using memfile lease backend.

Marcin Siodelski 12 years ago
parent
commit
bb6afeceea
2 changed files with 7 additions and 2 deletions
  1. 6 0
      src/lib/dhcpsrv/dhcpsrv_messages.mes
  2. 1 2
      src/lib/dhcpsrv/memfile_lease_mgr.cc

+ 6 - 0
src/lib/dhcpsrv/dhcpsrv_messages.mes

@@ -226,6 +226,12 @@ a database backend, but where no 'type' keyword has been included in
 the access string.  The access string (less any passwords) is included
 the access string.  The access string (less any passwords) is included
 in the message.
 in the message.
 
 
+% DHCPSRV_USING_MEMFILE_BACKEND using memfile database backend, leases will be lost after restart
+This warning message is issued when the server is configured to use default
+'memfile' backend to store leases. The leases held by this backend are
+lost on server's restart. Currently 'memfile' backend is usable for testing
+purposes mainly.
+
 % DHCPSRV_UNKNOWN_DB unknown database type: %1
 % DHCPSRV_UNKNOWN_DB unknown database type: %1
 The database access string specified a database type (given in the
 The database access string specified a database type (given in the
 message) that is unknown to the software.  This is a configuration error.
 message) that is unknown to the software.  This is a configuration error.

+ 1 - 2
src/lib/dhcpsrv/memfile_lease_mgr.cc

@@ -22,8 +22,7 @@ using namespace isc::dhcp;
 
 
 Memfile_LeaseMgr::Memfile_LeaseMgr(const ParameterMap& parameters)
 Memfile_LeaseMgr::Memfile_LeaseMgr(const ParameterMap& parameters)
     : LeaseMgr(parameters) {
     : LeaseMgr(parameters) {
-    std::cout << "Warning: Using memfile database backend. It is usable for limited"
-              << " testing only. Leases will be lost after restart." << std::endl;
+    LOG_WARN(dhcpsrv_logger, DHCPSRV_USING_MEMFILE_BACKEND);
 }
 }
 
 
 Memfile_LeaseMgr::~Memfile_LeaseMgr() {
 Memfile_LeaseMgr::~Memfile_LeaseMgr() {