Class: Cqpid::LoggerOutput

Inherits:
Object
  • Object
show all
Defined in:
ext/cqpid/cqpid.cpp

Instance Method Summary collapse

Instance Method Details

#log(*args) ⇒ Object



23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
# File 'ext/cqpid/cqpid.cpp', line 23234

SWIGINTERN VALUE
_wrap_LoggerOutput_log(int argc, VALUE *argv, VALUE self) {
  qpid::messaging::LoggerOutput *arg1 = (qpid::messaging::LoggerOutput *) 0 ;
  qpid::messaging::Level arg2 ;
  bool arg3 ;
  char *arg4 = (char *) 0 ;
  int arg5 ;
  char *arg6 = (char *) 0 ;
  std::string *arg7 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  int res6 ;
  char *buf6 = 0 ;
  int alloc6 = 0 ;
  int res7 = SWIG_OLDOBJ ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_qpid__messaging__LoggerOutput, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "qpid::messaging::LoggerOutput *","log", 1, self )); 
  }
  arg1 = reinterpret_cast< qpid::messaging::LoggerOutput * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "qpid::messaging::Level","log", 2, argv[0] ));
  } 
  arg2 = static_cast< qpid::messaging::Level >(val2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","log", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","log", 4, argv[2] ));
  }
  arg4 = reinterpret_cast< char * >(buf4);
  ecode5 = SWIG_AsVal_int(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","log", 5, argv[3] ));
  } 
  arg5 = static_cast< int >(val5);
  res6 = SWIG_AsCharPtrAndSize(argv[4], &buf6, NULL, &alloc6);
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "char const *","log", 6, argv[4] ));
  }
  arg6 = reinterpret_cast< char * >(buf6);
  {
    std::string *ptr = (std::string *)0;
    res7 = SWIG_AsPtr_std_string(argv[5], &ptr);
    if (!SWIG_IsOK(res7)) {
      SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "std::string const &","log", 7, argv[5] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","log", 7, argv[5])); 
    }
    arg7 = ptr;
  }
  {
    static VALUE eMessagingError = rb_define_class("MessagingError",
      rb_eStandardError);
    
    try {
      (arg1)->log(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,(std::string const &)*arg7);
    }
    catch(qpid::messaging::ConnectionError& error) {
      static VALUE merror = rb_define_class("ConnectionError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::TransportFailure& error) {
      static VALUE merror = rb_define_class("TransportFailure", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::TransactionAborted& error) {
      static VALUE merror = rb_define_class("TransactionAborted", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::TransactionUnknown& error) {
      static VALUE merror = rb_define_class("TransactionUnknown", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::TransactionError& error) {
      static VALUE merror = rb_define_class("TransactionError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::UnauthorizedAccess& error) {
      static VALUE merror = rb_define_class("UnauthorizedAccess", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::SessionError& error) {
      static VALUE merror = rb_define_class("SessionError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::TargetCapacityExceeded& error) {
      static VALUE merror = rb_define_class("TargetCapacityExceeded", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::SendError& error) {
      static VALUE merror = rb_define_class("SendError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::SenderError& error) {
      static VALUE merror = rb_define_class("SenderError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::NoMessageAvailable& error) {
      static VALUE merror = rb_define_class("NoMessageAvailable", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::FetchError& error) {
      static VALUE merror = rb_define_class("FetchError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::ReceiverError& error) {
      static VALUE merror = rb_define_class("ReceiverError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::InvalidOptionString& error) {
      static VALUE merror = rb_define_class("InvalidOptionString", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::KeyError& error) {
      static VALUE merror = rb_define_class("KeyError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::AssertionFailed& error) {
      static VALUE merror = rb_define_class("AssertionFailed", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::NotFound& error) {
      static VALUE merror = rb_define_class("NotFound", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::ResolutionError& error) {
      static VALUE merror = rb_define_class("ResolutionError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::MalformedAddress& error) {
      static VALUE merror = rb_define_class("MalformedAddress", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::AddressError& error) {
      static VALUE merror = rb_define_class("AddressError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::LinkError& error) {
      static VALUE merror = rb_define_class("LinkError", eMessagingError);
      rb_raise(merror, "%s", error.what());
    }
    catch(qpid::messaging::MessagingException& error) {
      rb_raise(eMessagingError, "%s", error.what());
    }
  }
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
  if (SWIG_IsNewObj(res7)) delete arg7;
  return Qnil;
fail:
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
  if (SWIG_IsNewObj(res7)) delete arg7;
  return Qnil;
}