1. 15 Jan, 2014 1 commit
  2. 28 Mar, 2013 1 commit
  3. 25 Mar, 2010 1 commit
    • Steven Murray's avatar
      This commit works towards resolving the following bug: · 7cdd6509
      Steven Murray authored
          bug #50008: Incorrect logging of nsfileid and nshost
      Added the following template function to the Dlf client API so that clients
      can specify the CASTOR file id and name server host as the context for a DLF
      message whilst also being able to specify the parameters as an array which the
      C++ ifunction template mechanism will automatically determine the size of in
      order to avoid potential segmentation faults.
          template<int numparams>
          void dlf_writep (Cuuid_t uuid,
                           int severity,
                           int message_no,
                           u_signed64 fileId,
                           std::string nsHost,
                           castor::dlf::Param (&params)[numparams]) throw() {
            dlf_writep(uuid, severity, message_no, fileId, nsHost, numparams,
  4. 18 Aug, 2009 1 commit
  5. 04 Feb, 2009 2 commits
    • Steven Murray's avatar
      Added another macro, this time called CASTOR_DLF_WRITEC, notice the lack of the · f946783d
      Steven Murray authored
      letter P at the end of the name.  There are now two macros to help generate
      log messages with the contextual information of file, line and function:
      The first macro logs a message without parameters accept for the three
      contextual ones of file, line and function.  The second macro logs a message
      with parameters to which the three contextual ones are prepended.
      The meaning of the letter C at the end of the CASTOR_DLF_WRITEC is 'C'onextual
      log.  The meaning iof the letter P at the end of CASTOR_DLF_WRITECP is with
    • Steven Murray's avatar
      Added the CASTOR_DLF_WRITEPC macro. · b63bb04d
      Steven Murray authored
      This macro should be used when it is desirable to include the file, line and
      function context information in a log.  It is advised to include such
      information when logging an error for the developers, but not to use it for
      monitoring logs where operators are informed of what is happening and they do
      not need or want to know the details of the source code.
      The CASTOR_DLF_WRITEPC macro macro generates the file, line and function
      context information automatically and passes it on down the DLF logging chain.
      This means developers do not need to use the __FILE__, __LINE__,
      __PRETTY_FUNCTION__ macros in their application code when logging.  Here is an
      example of using this macro:
        try {
        } catch(castor::exception::Exception &ex) {
          castor::dlf::Param params[] = {
            castor::dlf::Param("volReqId", vdqmJobRequest.tapeRequestId),
            castor::dlf::Param("Message" , ex.getMessage().str()       ),
            castor::dlf::Param("Code"    , ex.code()                   )};
  6. 31 Jan, 2009 1 commit
    • Steven Murray's avatar
      Added the following C++ template wrapper around the castor::dlf::dlf_writep · 624b0397
      Steven Murray authored
      function in order to allow developers to call the function without the need to
      specify the size of the params array:
          template<int n>
            void dlf_writep (Cuuid_t uuid,
                             int severity,
                             int message_no,
                             castor::dlf::Param (&params)[n],
                             struct Cns_fileid *ns_invariant = 0) throw() {
            dlf_writep(uuid, severity, message_no, n, params, 0);
      The template causes the size of the array to be determied at compile time.  A
      pointer to castor::dlf::Param will of course not work.  The original
      castor::dlf::dlf_writep function can be used as usual in this case.
      The following code snippet shows an example of using the new template:
        castor::dlf::Param params[] = {
          castor::dlf::Param("volReqId", vdqmJobRequest.tapeRequestId),
          castor::dlf::Param("vid"     , request.vid                 ),
          castor::dlf::Param("vsn"     , request.vsn                 ),
          castor::dlf::Param("label"   , request.label               ),
          castor::dlf::Param("devtype" , request.devtype             ),
          castor::dlf::Param("density" , request.density             )};
              castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM,
                AGGREGATOR_GAVE_VOLUME_INFO, params);
  7. 14 Mar, 2008 1 commit
  8. 10 Mar, 2008 1 commit
  9. 05 Mar, 2008 1 commit
  10. 17 Aug, 2007 1 commit
  11. 16 Aug, 2007 1 commit
  12. 25 Sep, 2006 1 commit
  13. 13 Jun, 2006 1 commit
  14. 05 Apr, 2005 1 commit