Class: Cqpid::Logger

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

Class Method Summary collapse

Class Method Details

.configure(*args, self) ⇒ Object



23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
# File 'ext/cqpid/cqpid.cpp', line 23673

SWIGINTERN VALUE _wrap_Logger_configure(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_char, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Logger_configure__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_char, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Logger_configure__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Logger.configure", 
    "    void Logger.configure(int argc, char const *argv[], std::string const &prefix)\n"
    "    void Logger.configure(int argc, char const *argv[])\n");
  
  return Qnil;
}

.log(*args) ⇒ Object



23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
# File 'ext/cqpid/cqpid.cpp', line 23955

SWIGINTERN VALUE
_wrap_Logger_log(int argc, VALUE *argv, VALUE self) {
  qpid::messaging::Level arg1 ;
  char *arg2 = (char *) 0 ;
  int arg3 ;
  char *arg4 = (char *) 0 ;
  std::string *arg5 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  int res5 = SWIG_OLDOBJ ;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "qpid::messaging::Level","qpid::messaging::Logger::log", 1, argv[0] ));
  } 
  arg1 = static_cast< qpid::messaging::Level >(val1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","qpid::messaging::Logger::log", 2, argv[1] ));
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","qpid::messaging::Logger::log", 3, argv[2] ));
  } 
  arg3 = static_cast< int >(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","qpid::messaging::Logger::log", 4, argv[3] ));
  }
  arg4 = reinterpret_cast< char * >(buf4);
  {
    std::string *ptr = (std::string *)0;
    res5 = SWIG_AsPtr_std_string(argv[4], &ptr);
    if (!SWIG_IsOK(res5)) {
      SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "std::string const &","qpid::messaging::Logger::log", 5, argv[4] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","qpid::messaging::Logger::log", 5, argv[4])); 
    }
    arg5 = ptr;
  }
  {
    static VALUE eMessagingError = rb_define_class("MessagingError",
      rb_eStandardError);
    
    try {
      qpid::messaging::Logger::log(arg1,(char const *)arg2,arg3,(char const *)arg4,(std::string const &)*arg5);
    }
    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 (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  if (SWIG_IsNewObj(res5)) delete arg5;
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  if (SWIG_IsNewObj(res5)) delete arg5;
  return Qnil;
}

.setOutput(*args) ⇒ Object



23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
# File 'ext/cqpid/cqpid.cpp', line 23837

SWIGINTERN VALUE
_wrap_Logger_setOutput(int argc, VALUE *argv, VALUE self) {
  qpid::messaging::LoggerOutput *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_qpid__messaging__LoggerOutput,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "qpid::messaging::LoggerOutput &","qpid::messaging::Logger::setOutput", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "qpid::messaging::LoggerOutput &","qpid::messaging::Logger::setOutput", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< qpid::messaging::LoggerOutput * >(argp1);
  {
    static VALUE eMessagingError = rb_define_class("MessagingError",
      rb_eStandardError);
    
    try {
      qpid::messaging::Logger::setOutput(*arg1);
    }
    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());
    }
  }
  return Qnil;
fail:
  return Qnil;
}

.usage(*args) ⇒ Object



23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
# File 'ext/cqpid/cqpid.cpp', line 23727

SWIGINTERN VALUE
_wrap_Logger_usage(int argc, VALUE *argv, VALUE self) {
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    static VALUE eMessagingError = rb_define_class("MessagingError",
      rb_eStandardError);
    
    try {
      result = qpid::messaging::Logger::usage();
    }
    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());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}