Field3D
Msg Namespace Reference

Contains logging-related functions. More...

Enumerations

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

Functions

FIELD3D_API void print (Severity severity, const std::string &message)
 Sends the string to the assigned output, prefixing the message with the severity. More...
 
void print (const std::string &message)
 Sends the string to the assigned output. 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 verbosity = 1
 

Detailed Description

Contains logging-related functions.

Enumeration Type Documentation

Used by the Msg::print() call.

Enumerator
SevMessage 
SevWarning 

Definition at line 66 of file Log.h.

66  {
67  SevMessage,
69  };

Function Documentation

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 66 of file Log.cpp.

References SevMessage, and SevWarning.

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

67 {
68  if (verbosity < 1)
69  return;
70 
71  switch(severity) {
72  case SevWarning:
73  cout << "WARNING: ";
74  break;
75  case SevMessage:
76  default:
77  break;
78  // Do nothing
79  }
80 
81  cout << message << endl;
82 }
static int verbosity
Definition: Log.cpp:61
void Msg::print ( const std::string &  message)
inline

Sends the string to the assigned output.

Definition at line 76 of file Log.h.

References FIELD3D_API, FIELD3D_NAMESPACE_HEADER_CLOSE, print(), setVerbosity(), and SevMessage.

77  { print(SevMessage, message); }
void print(const std::string &message)
Sends the string to the assigned output.
Definition: Log.h:76
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 86 of file Log.cpp.

References FIELD3D_NAMESPACE_SOURCE_CLOSE.

Referenced by print().

87 {
88  verbosity = level;
89 }
static int verbosity
Definition: Log.cpp:61

Variable Documentation

int Msg::verbosity = 1
static

Definition at line 61 of file Log.cpp.