@@ -191,13 +191,9 @@ class Writer {
191191 private:
192192 template <class T >
193193 void set_value (const T& _var, avro_value_t * _val) const {
194- std::cout << " [DEBUG] set_value called with type: " << typeid (T).name () << std::endl;
195-
196194 if constexpr (std::is_same<std::remove_cvref_t <T>, std::string>()) {
197- std::cout << " [DEBUG] Processing std::string: " << _var << std::endl;
198195 int result = avro_value_set_string_len (_val, _var.c_str (), _var.size () + 1 );
199196 if (result != 0 ) {
200- std::cout << " [DEBUG] avro_value_set_string_len failed with result: " << result << std::endl;
201197 throw std::runtime_error (std::string (__FUNCTION__) + " error(" + std::to_string (result)+" ): " + avro_strerror ());
202198 }
203199 } else if constexpr (std::is_same<std::remove_cvref_t <T>,
@@ -206,61 +202,43 @@ class Writer {
206202 rfl::Vectorstring>()) {
207203 auto var = _var;
208204 if (!var.data ()) {
209- std::cout << " [DEBUG] Bytestring/Vectorstring has no data" << std::endl;
210205 return ;
211206 }
212- std::cout << " [DEBUG] Processing Bytestring/Vectorstring of size: " << var.size () << std::endl;
213207 int result = avro_value_set_bytes (_val, var.data (), var.size ());
214208 if (result != 0 ) {
215- std::cout << " [DEBUG] avro_value_set_bytes failed with result: " << result << std::endl;
216209 throw std::runtime_error (std::string (__FUNCTION__) + " error(" + std::to_string (result)+" ): " + avro_strerror ());
217210 }
218211 } else if constexpr (std::is_same<std::remove_cvref_t <T>, bool >()) {
219- std::cout << " [DEBUG] Processing bool: " << _var << std::endl;
220212 int result = avro_value_set_boolean (_val, _var);
221213 if (result != 0 ) {
222- std::cout << " [DEBUG] avro_value_set_boolean failed with result: " << result << std::endl;
223214 throw std::runtime_error (std::string (__FUNCTION__) + " error(" + std::to_string (result)+" ): " + avro_strerror ());
224215 }
225216 } else if constexpr (std::is_floating_point<std::remove_cvref_t <T>>()) {
226- std::cout << " [DEBUG] Processing floating point: " << _var << std::endl;
227217 int result = avro_value_set_double (_val, static_cast <double >(_var));
228218 if (result != 0 ) {
229- std::cout << " [DEBUG] avro_value_set_double failed with result: " << result << std::endl;
230219 throw std::runtime_error (std::string (__FUNCTION__) + " error(" + std::to_string (result)+" ): " + avro_strerror ());
231220 }
232221 } else if constexpr (std::is_integral<std::remove_cvref_t <T>>()) {
233- std::cout << " [DEBUG] Processing integral: " << _var << std::endl;
234222 int result = avro_value_set_long (_val, static_cast <std::int64_t >(_var));
235223 if (result != 0 ) {
236- std::cout << " [DEBUG] avro_value_set_long failed with result: " << result << std::endl;
237224 throw std::runtime_error (std::string (__FUNCTION__) + " error(" + std::to_string (result)+" ): " + avro_strerror ());
238225 }
239226 } else if constexpr (internal::is_literal_v<T>) {
240- std::cout << " [DEBUG] Processing literal enum: " << static_cast <int >(_var.value ()) << std::endl;
241227 int result = avro_value_set_enum (_val, static_cast <int >(_var.value ()));
242228 if (result != 0 ) {
243- std::cout << " [DEBUG] avro_value_set_enum failed with result: " << result << std::endl;
244229 throw std::runtime_error (std::string (__FUNCTION__) + " error(" + std::to_string (result)+" ): " + avro_strerror ());
245230 }
246231 } else if constexpr (internal::is_validator_v<T>) {
247- std::cout << " [DEBUG] Processing validator type" << std::endl;
248- // Для валидаторов используем внутреннее значение
249232 using ValueType = std::remove_cvref_t <typename T::ReflectionType>;
250233 const auto val = _var.value ();
251234 set_value<ValueType>(val, _val);
252235 } else if constexpr (std::is_same<std::remove_cvref_t <T>, rfl::Timestamp<" %Y-%m-%d" >>()) {
253- std::cout << " [DEBUG] Processing Timestamp" << std::endl;
254- // Конвертируем Timestamp в строку
255236 const auto str = _var.to_string ();
256237 set_value<std::string>(str, _val);
257238 } else if constexpr (std::is_same<std::remove_cvref_t <T>, rfl::Email>()) {
258- std::cout << " [DEBUG] Processing Email" << std::endl;
259- // Email является паттерном на базе std::string, используем внутреннее значение
260239 const auto & str = static_cast <const std::string&>(_var);
261240 set_value<std::string>(str, _val);
262241 } else {
263- std::cout << " [DEBUG] Unsupported type reached: " << typeid (T).name () << std::endl;
264242 static_assert (rfl::always_false_v<T>, " Unsupported type." );
265243 }
266244 }
0 commit comments