Dlf.hpp 2.92 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/******************************************************************************
 *                      dlf_write.hpp
 *
 * This file is part of the Castor project.
 * See http://castor.web.cern.ch/castor
 *
 * Copyright (C) 2003  CERN
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
20
 * @(#)$RCSfile: Dlf.hpp,v $ $Revision: 1.3 $ $Release$ $Date: 2006/09/25 13:28:02 $ $Author: sponcec3 $
21
22
23
24
25
26
27
28
29
30
 *
 * C++ interface to DLF
 *
 * @author Sebastien Ponce
 *****************************************************************************/

#ifndef DLF_DLF_WRITE_HPP 
#define DLF_DLF_WRITE_HPP 1

// Include Files
31
#include "dlf_api.h"
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "castor/dlf/Message.hpp"
#include "castor/dlf/Param.hpp"

namespace castor {

  namespace dlf {

    /**
     * Initialization of the DLF logging system
     * @param facilityName name of the DLF facility to use
     * @param messages array of messages to decalre in the
     * facility. The end of the array is marked by a
     * message with negative number.
     */
    void dlf_init(char* facilityName,
                  Message messages[]);

49
50
51
52
53
54
55
56
57
58
59
    /**
     * Adds messages to the current DLF facility
     * @param offset the offset to add to each message number.
     * This is to avoid collisions with previously added messages
     * @param messages array of messages to decalre in the
     * facility. The end of the array is marked by a
     * message with negative number.
     */
    void dlf_addMessages(int offset,
                         Message messages[]);

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
    /**
     * prints a message into dlf.
     * @param uuid the uuid of the component issuing the message
     * @param message_no the message number in the facility.
     * @param severity the severity of the message.
     * @param numparams the number of parameters in the message
     * @param params the parameters of the message, given as an array
     * @ns_invariant the castor file concerned by the message
     * (if any), given as a name server fileId.
     */
    void dlf_writep (Cuuid_t uuid,
                     int severity,
                     int message_no,
                     int numparams = 0,
                     castor::dlf::Param params[] = 0,
                     struct Cns_fileid *ns_invariant = 0);

 } // end of namespace dlf

} // end of namespace castor


#endif // DLF_DLF_WRITE_HPP