LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros
log.hxx File Reference
#include <sal/config.h>
#include <cstdlib>
#include <sstream>
#include <string>
#include <sal/detail/log.h>
#include <sal/saldllapi.h>
#include <sal/types.h>

Go to the source code of this file.

Macros

#define SAL_WHERE   SAL_DETAIL_WHERE
 A simple macro to create a "file and line number" string. More...
 
#define SAL_STREAM(stream)   (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str())
 A facility for generating temporary string messages by piping items into a C++ std::ostringstream. More...
 
#define SAL_INFO(area, stream)
 Produce log entry from stream in the given log area. More...
 
#define SAL_INFO_IF(condition, area, stream)
 Produce log entry from stream in the given log area if condition is true. More...
 
#define SAL_WARN(area, stream)
 Produce warning entry from stream in the given log area. More...
 
#define SAL_WARN_IF(condition, area, stream)
 Produce warning entry from stream in the given log area if condition is true. More...
 
#define SAL_DEBUG(stream)
 Produce temporary debugging output from stream. More...
 
#define SAL_DEBUG_TRACE(stream)
 Produce temporary debugging output from stream along with a stack trace of the calling location. More...
 

Macro Definition Documentation

#define SAL_DEBUG (   stream)
Value:
SAL_DETAIL_LOG_STREAM( \
SAL_LOG_TRUE, ::SAL_DETAIL_LOG_LEVEL_DEBUG, NULL, NULL, stream)

Produce temporary debugging output from stream.

This macro is meant to be used only while working on code and should never exist in production code.

See basic logging functionality for details.

#define SAL_DEBUG_TRACE (   stream)
Value:
SAL_DETAIL_LOG_STREAM( \
SAL_LOG_TRUE, ::SAL_DETAIL_LOG_LEVEL_DEBUG_TRACE, NULL, NULL, stream)

Produce temporary debugging output from stream along with a stack trace of the calling location.

This macro is meant to be used only while working on code and should never exist in production code.

See basic logging functionality for details.

#define SAL_INFO (   area,
  stream 
)
Value:
SAL_DETAIL_LOG_STREAM( \
SAL_DETAIL_ENABLE_LOG_INFO, ::SAL_DETAIL_LOG_LEVEL_INFO, area, \
SAL_WHERE, stream)
#define SAL_WHERE
A simple macro to create a &quot;file and line number&quot; string.
Definition: log.hxx:144

Produce log entry from stream in the given log area.

See basic logging functionality for details.

#define SAL_INFO_IF (   condition,
  area,
  stream 
)
Value:
SAL_DETAIL_LOG_STREAM( \
SAL_DETAIL_ENABLE_LOG_INFO && (condition), \
::SAL_DETAIL_LOG_LEVEL_INFO, area, SAL_WHERE, stream)
#define SAL_WHERE
A simple macro to create a &quot;file and line number&quot; string.
Definition: log.hxx:144

Produce log entry from stream in the given log area if condition is true.

See basic logging functionality for details.

#define SAL_STREAM (   stream)    (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str())

A facility for generating temporary string messages by piping items into a C++ std::ostringstream.

This can be useful for example in a call to SAL_INFO when depending on some boolean condition data of incompatible types shall be streamed into the message, as in:

SAL_INFO("foo", "object: " << (hasName ? obj->name : SAL_STREAM(obj)));

Attention
For now, this functionality should only be used internally within LibreOffice. It may change again in a future version.
Since
LibreOffice 3.5
#define SAL_WARN (   area,
  stream 
)
Value:
SAL_DETAIL_LOG_STREAM( \
SAL_DETAIL_ENABLE_LOG_WARN, ::SAL_DETAIL_LOG_LEVEL_WARN, area, \
SAL_WHERE, stream)
#define SAL_WHERE
A simple macro to create a &quot;file and line number&quot; string.
Definition: log.hxx:144

Produce warning entry from stream in the given log area.

See basic logging functionality for details.

#define SAL_WARN_IF (   condition,
  area,
  stream 
)
Value:
SAL_DETAIL_LOG_STREAM( \
SAL_DETAIL_ENABLE_LOG_WARN && (condition), \
::SAL_DETAIL_LOG_LEVEL_WARN, area, SAL_WHERE, stream)
#define SAL_WHERE
A simple macro to create a &quot;file and line number&quot; string.
Definition: log.hxx:144

Produce warning entry from stream in the given log area if condition is true.

See basic logging functionality for details.

#define SAL_WHERE   SAL_DETAIL_WHERE

A simple macro to create a "file and line number" string.

Potentially not only useful within the log framework (where it is used automatically), but also when creating exception messages.

Attention
For now, this functionality should only be used internally within LibreOffice. It may change again in a future version.
Since
LibreOffice 3.5