class LogCommand implements CommandHasRequest<LogRequest, CommandResponse> {

	@Override
	public void execute(LogRequest request, CommandResponse response) throws Exception {
		switch (request.getLevel()) {
			case LogRequest.LEVEL_DEBUG:
				log.debug(request.getStatement());
				break;
			case LogRequest.LEVEL_INFO:
				log.info(request.getStatement());
				break;
			case LogRequest.LEVEL_WARN:
				log.warn(request.getStatement());
				break;
			case LogRequest.LEVEL_ERROR:
				log.error(request.getStatement());
				break;
			default:
				throw new IllegalArgumentException("Unknown log level " + request.getLevel());
		}
	}

}