| 44 | LogConfigHandler & LogConfigHandler::operator=(const LogConfigHandler & source) = default; |
| 45 | |
| 46 | Param LogConfigHandler::parse(const StringList & settings) |
| 47 | { |
| 48 | Param p; |
| 49 | String suffix = " FILE"; |
| 50 | std::vector<std::string> commands; |
| 51 | for (StringList::const_iterator iter = settings.begin(); iter != settings.end(); ++iter) |
| 52 | { |
| 53 | // split by " " to get all keywords |
| 54 | StringList l; |
| 55 | (*iter).split(' ', l, true); |
| 56 | |
| 57 | if (l.size() < 2 || l.size() > 3) |
| 58 | { |
| 59 | throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, (*iter), "Error while parsing logger config. Setting can only have 2 or 3 arguments."); |
| 60 | } |
| 61 | |
| 62 | // we parse a command line here, so we append a FILE to each of the arguments |
| 63 | // to indicate, that all of these streams are FILE streams |
| 64 | // for cout/cerr the type parameter is ignored |
| 65 | String new_command = *iter + suffix; |
| 66 | commands.push_back(new_command); |
| 67 | } |
| 68 | |
| 69 | p.setValue(LogConfigHandler::PARAM_NAME, commands, "List of all settings that should be applied to the current Logging Configuration"); |
| 70 | |
| 71 | return p; |
| 72 | } |
| 73 | |
| 74 | void LogConfigHandler::configure(const Param & param) |
| 75 | { |