Esempio n. 1
0
inline typename std::remove_reference<T>::type convertArg(const Args& args, std::size_t index)
{
    try
    {
        return args[index].to<typename std::remove_reference<T>::type>();
    }
    catch (const BadType&)
    {
        PONDER_ERROR(BadArgument(args[index].type(), mapType<T>(), index, "constructor"));
    }
}
Esempio n. 2
0
void LoggerConfig::set(const logger::LogType type,
                       const logger::LogLevel level,
                       const std::string &arg)
{
    if (type == logger::LogType::LOG_FILE || type == logger::LogType::LOG_PERSISTENT_FILE) {
        if (arg.empty()) {
            const std::string msg = "Path needs to be specified in the agument";
            LOGE(msg);
            throw BadArgument(msg);
        }
    }

    mType = type;
    mLevel = level;
    mArg = arg;
}