}
catch (const std::exception& ex) {
// Log the error and return failure.
- std::cout << "DHCP UserCheckHook could not be loaded: "
- << ex.what() << std::endl;
+ LOG_ERROR(user_chk_logger, USER_CHK_HOOK_LOAD_ERROR)
+ .arg(ex.what());
ret_val = 1;
}
} catch (const std::exception& ex) {
// On the off chance something goes awry, catch it and log it.
// @todo Not sure if we should return a non-zero result or not.
- std::cout << "DHCP UserCheckHook could not be unloaded: "
- << ex.what() << std::endl;
+ LOG_ERROR(user_chk_logger, USER_CHK_HOOK_UNLOAD_ERROR)
+ .arg(ex.what());
}
return (0);
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013,2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
#include <dhcp/pkt6.h>
#include <dhcpsrv/subnet.h>
#include <user_chk.h>
+#include <user_chk_log.h>
using namespace isc::dhcp;
using namespace isc::hooks;
/// @return 0 upon success, non-zero otherwise.
int subnet4_select(CalloutHandle& handle) {
if (!user_registry) {
- std::cout << "DHCP UserCheckHook : subnet4_select UserRegistry is null"
- << std::endl;
+ LOG_ERROR(user_chk_logger, USER_CHK_SUBNET4_SELECT_REGISTRY_NULL);
return (1);
}
handle.setArgument("subnet4", subnet);
}
} catch (const std::exception& ex) {
- std::cout << "DHCP UserCheckHook : subnet6_select unexpected error: "
- << ex.what() << std::endl;
+ LOG_ERROR(user_chk_logger, USER_CHK_SUBNET4_SELECT_ERROR)
+ .arg(ex.what());
return (1);
}
/// @return 0 upon success, non-zero otherwise.
int subnet6_select(CalloutHandle& handle) {
if (!user_registry) {
- std::cout << "DHCP UserCheckHook : subnet6_select UserRegistry is null"
- << std::endl;
+ LOG_ERROR(user_chk_logger, USER_CHK_SUBNET6_SELECT_REGISTRY_NULL);
return (1);
}
handle.setArgument("subnet6", subnet);
}
} catch (const std::exception& ex) {
- std::cout << "DHCP UserCheckHook : subnet6_select unexpected error: "
- << ex.what() << std::endl;
+ LOG_ERROR(user_chk_logger, USER_CHK_SUBNET6_SELECT_ERROR)
+ .arg(ex.what());
return (1);
}