Public Member Functions | Private Attributes

log_ivdfs Class Reference
[G_new_group]

#include <log_ivdfs.h>

Inheritance diagram for log_ivdfs:
Inheritance graph
[legend]
Collaboration diagram for log_ivdfs:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 log_ivdfs ()
 log_ivdfs (const string &a_partName)
void Init (const string &a_partName)
void Write (ivd_FileID_t a_fileID, UInt64_t a_migID, const string &a_path, const char *a_msg)
void Write (ivd_GenInode_t a_inode, ivd_FileID_t a_fileID, UInt64_t a_migID, const string &a_newPath, const string &a_oldPath, hsm_ChgFlag_t a_chgFlags)
void Write (ivd_GenInode_t a_inode, ivd_FileID_t a_fileID, UInt32_t a_hsmJobID, const string &a_path, const char *a_msg)
void WriteHL7MsgNotification (const string &a_hl7message)

Private Attributes

const string m_partName
cmn_Mutex m_fsLogOut_x

Detailed Description

Definition at line 44 of file log_ivdfs.h.


Constructor & Destructor Documentation

log_ivdfs::log_ivdfs (  )  [inline]

Definition at line 46 of file log_ivdfs.h.

{};

log_ivdfs::log_ivdfs ( const string &  a_partName  )  [inline]

Definition at line 48 of file log_ivdfs.h.

                                        {
        Init(a_partName);
    };


Member Function Documentation

void log_ivdfs::Init ( const string &  a_partName  ) 

Definition at line 50 of file log_ivdfs.cpp.

References cmn_Global::dirs, g_cmn, ivd_Directories::log, and log_File::SetFileName().

Referenced by i_FSC_i::i_FSC_i(), and main().

                                             {
    SetFileName(g_cmn.dirs.log + (string("hsmfs_") + a_partName + string(".log")));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void log_ivdfs::Write ( ivd_FileID_t  a_fileID,
UInt64_t  a_migID,
const string &  a_path,
const char *  a_msg 
)

Definition at line 55 of file log_ivdfs.cpp.

References m_fsLogOut_x, and log_File::WriteF().

Referenced by hsm_FileHeader::Event(), hsm_FileHeader::MigrationIsDone(), i_HSM_i::Recall(), hsm_FileHeader::Recalled(), and fsc_DataL::Write2DB().

                                         {

    cmn_MutexLock l (m_fsLogOut_x);

    ostringstream sstr;
    sstr << "[" << cmn_Time().Time2YMDhms() << ", " << a_fileID;
    if (a_migID) {
        sstr << ":" << a_migID;
    }
    
    // File names are written in UTF-8: No conversion is done.
    sstr << ", \"" << a_path.c_str() << "\"] " << a_msg << endl;
    
    WriteF(sstr.str().data(), ivd_FileBufSize_t(sstr.str().length()) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void log_ivdfs::Write ( ivd_GenInode_t  a_inode,
ivd_FileID_t  a_fileID,
UInt32_t  a_hsmJobID,
const string &  a_path,
const char *  a_msg 
)

Definition at line 116 of file log_ivdfs.cpp.

References IVD_PRINT_ID_FS, m_fsLogOut_x, and log_File::WriteF().

                                         {

    cmn_MutexLock l (m_fsLogOut_x);

    ostringstream sstr;
    sstr << "[" << cmn_Time().Time2YMDhms() 
            << ", " << IVD_PRINT_ID_FS(a_inode)
            << ", " << a_fileID
            << ", " << a_hsmJobID;

    sstr << ", \"" << a_path.c_str() << "\"] " << a_msg << endl;
    WriteF(sstr.str().data(), ivd_FileBufSize_t(sstr.str().length()) );
}

Here is the call graph for this function:

void log_ivdfs::Write ( ivd_GenInode_t  a_inode,
ivd_FileID_t  a_fileID,
UInt64_t  a_migID,
const string &  a_newPath,
const string &  a_oldPath,
hsm_ChgFlag_t  a_chgFlags 
)

Definition at line 75 of file log_ivdfs.cpp.

References CHG_ATTR_d, CHG_CHGSTREAM_d, CHG_CREATE_d, CHG_DELETED_d, CHG_NAMEOWN_d, IVD_PRINT_ID_FS, m_fsLogOut_x, and log_File::WriteF().

                                                 {

    cmn_MutexLock l (m_fsLogOut_x);

    string msg;
    if (a_chgFlags & CHG_CREATE_d) {
        msg = "Added.";
    }
    else if (a_chgFlags & CHG_DELETED_d) {
        msg = "Deleted.";
    }
    else if (a_chgFlags & CHG_CHGSTREAM_d) {
        msg = "Changed.";
    }
    else if (a_chgFlags & CHG_ATTR_d) {
        msg = "AttrChanged.";
    }
    else if (a_chgFlags & CHG_NAMEOWN_d) {
        msg = "Moved/Renamed.";
    }

    ostringstream sstr;
    sstr << "[" << cmn_Time().Time2YMDhms() 
            << ", " << IVD_PRINT_ID_FS(a_inode)
            << ", " << a_fileID;
    if (a_migID) {
        sstr << ":" << a_migID;
    }
    
    sstr << ", \"" << a_newPath.c_str()
         << "\", \"" << a_oldPath.c_str() << "\"] " << msg << endl;
         
    WriteF(sstr.str().data(), ivd_FileBufSize_t(sstr.str().length()) );
}

Here is the call graph for this function:

void log_ivdfs::WriteHL7MsgNotification ( const string &  a_hl7message  ) 

Definition at line 135 of file log_ivdfs.cpp.

References cmn_StrTokenize(), log_FUNC_m, m_fsLogOut_x, path, and log_File::WriteF().

Referenced by hsm_HL7MessageProxy::SendMessages().

                                                                  {
    log_FUNC_m(WriteHL7MsgNotification);
    cmn_MutexLock l (m_fsLogOut_x);

    // get fullfilename from message (last two fields in HL7 message)
    vector<string> message_v = cmn_StrTokenize(a_hl7message, "|");
    string filename = message_v.back();
    filename = filename.substr(0, filename.size() - 1);

    message_v.resize(message_v.size() -1);
    string gidCidDir = message_v.back();

    cmn_Path path = gidCidDir + filename;

    ostringstream sstr;
    sstr << "[" << cmn_Time().Time2YMDhms() << ", \"" << path << "\"] "
         << "HL7 message sent." << endl;

    WriteF(sstr.str().data(), ivd_FileBufSize_t(sstr.str().length()) );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 74 of file log_ivdfs.h.

Referenced by Write(), and WriteHL7MsgNotification().

const string log_ivdfs::m_partName [private]

Definition at line 73 of file log_ivdfs.h.


The documentation for this class was generated from the following files: