Field3D
Msg Namespace Reference

Contains logging-related functions. More...

Enumerations

enum  Severity { SevMessage, SevWarning }
 Used by the Msg::print() call. More...
 

Functions

void print (const std::string &message)
 Sends the string to the assigned output. More...
 
FIELD3D_API void print (Severity severity, const std::string &message)
 Sends the string to the assigned output, prefixing the message with the severity. More...
 
FIELD3D_API void setVerbosity (int level=1)
 Set the verbosity level of console output: 0 = do not echo anything to the console; >=1 = echo all messages and warnings to the console. More...
 

Variables

static int g_verbosity = 1
 

Detailed Description

Contains logging-related functions.

Enumeration Type Documentation

◆ Severity

Used by the Msg::print() call.

Enumerator
SevMessage 
SevWarning 

Definition at line 66 of file Log.h.

66  {
67  SevMessage,
69  };

Function Documentation

◆ print() [1/2]

void Msg::print ( Severity  severity,
const std::string &  message 
)

Sends the string to the assigned output, prefixing the message with the severity.

Definition at line 70 of file Log.cpp.

71 {
72  if (g_verbosity < 1)
73  return;
74 
75  switch(severity) {
76  case SevWarning:
77  cout << "WARNING: ";
78  break;
79  case SevMessage:
80  default:
81  break;
82  // Do nothing
83  }
84 
85  cout << message << endl;
86 }

References g_verbosity, SevMessage, and SevWarning.

Referenced by SparseFile::Reference< Data_T >::closeFile(), Field3DFileHDF5Base::closeInternal(), Field3DOutputFileHDF5::create(), Field3DOutputFile::createNewPartition(), Field3DOutputFileHDF5::createNewPartition(), SparseField< Data_T >::fastLValue(), FileSequence::FileSequence(), findRegistrationFunc(), Field3DFileBase::getIntScalarLayerNames(), Field3DFileHDF5Base::getIntScalarLayerNames(), Field3DFileBase::getIntVectorLayerNames(), Field3DFileHDF5Base::getIntVectorLayerNames(), PluginLoader::loadPlugins(), Field3DInputFile::open(), Field3DInputFileHDF5::open(), SparseFile::Reference< Data_T >::openFile(), SparseField< Data_T >::iterator::operator*(), SparseField< Data_T >::iterator::operator->(), Field3DInputFileHDF5::parseLayer(), print(), NullFieldMappingIO::read(), MatrixFieldMappingIO::read(), FrustumFieldMappingIO::read(), readField(), readFieldMapping(), Field3DInputFileHDF5::readGroupMembership(), Field3DInputFile::readLayer(), Field3DInputFileHDF5::readLayer(), Field3DInputFileHDF5::readMetadata(), Field3DInputFile::readPartitionAndLayerInfo(), Field3DInputFileHDF5::readPartitionAndLayerInfo(), Field3DInputFile::readProxyLayer(), Field3DInputFileHDF5::readProxyLayer(), ClassFactory::registerField(), ClassFactory::registerFieldIO(), ClassFactory::registerFieldMapping(), ClassFactory::registerFieldMappingIO(), FieldRes::setMapping(), FieldWrapper< Field_T >::setOsToWs(), MIPFieldWrapper< Field_T >::setOsToWs(), NullFieldMappingIO::write(), MatrixFieldMappingIO::write(), FrustumFieldMappingIO::write(), Hdf5Util::writeAttribute(), writeField(), writeFieldMapping(), Field3DOutputFile::writeGlobalMetadata(), Field3DOutputFileHDF5::writeGlobalMetadata(), Field3DOutputFile::writeGroupMembership(), Field3DOutputFileHDF5::writeGroupMembership(), Field3DOutputFileHDF5::writeLayer(), Field3DOutputFile::writeLayer(), Field3DOutputFileHDF5::writeMapping(), Field3DOutputFile::writeMapping(), Field3DOutputFileHDF5::writeMetadata(), Field3DOutputFile::writeMetadata(), Field3DOutputFileHDF5::writeScalarLayer(), and Field3DOutputFileHDF5::writeVectorLayer().

◆ print() [2/2]

void Msg::print ( const std::string &  message)
inline

Sends the string to the assigned output.

Definition at line 76 of file Log.h.

77  { print(SevMessage, message); }

References print(), and SevMessage.

◆ setVerbosity()

void Msg::setVerbosity ( int  level = 1)

Set the verbosity level of console output: 0 = do not echo anything to the console; >=1 = echo all messages and warnings to the console.

Definition at line 90 of file Log.cpp.

91 {
92  g_verbosity = level;
93 }

References g_verbosity.

Variable Documentation

◆ g_verbosity

int Msg::g_verbosity = 1
static

Definition at line 66 of file Log.cpp.

Referenced by print(), and setVerbosity().

Msg::SevMessage
@ SevMessage
Definition: Log.h:67
Msg::SevWarning
@ SevWarning
Definition: Log.h:68
Msg::print
void print(const std::string &message)
Sends the string to the assigned output.
Definition: Log.h:76
Msg::g_verbosity
static int g_verbosity
Definition: Log.cpp:66