layout: doc title: “Starboard Module Reference: log.h”

Defines debug logging functions.

Enums

SbLogPriority

The priority at which a message should be logged. The platform may be configured to filter logs by priority, or render them differently.

Values

  • kSbLogPriorityUnknown
  • kSbLogPriorityInfo
  • kSbLogPriorityWarning
  • kSbLogPriorityError
  • kSbLogPriorityFatal

Macros

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Compatibility with base/logging.h which defines ERROR to be 0 to workaround some system header defines that do the same thing.

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Note that this macro's definition varies depending on the values of one or more other variables.

Functions

Break

Declaration

SB_EXPORT void Break();

GetMinLogLevel

Declaration

SB_EXPORT SbLogPriority GetMinLogLevel();

SbLog

Description

Writes message to the platform's debug output log.

Declaration and definitions

#include "starboard/log.h"

void SbLog(SbLogPriority /*priority*/, const char* /*message*/) {
}

Parameters

SbLogFlush

Description

Flushes the log buffer on some platforms.

Declaration and definitions

#include "starboard/log.h"

void SbLogFlush() {
}

SbLogFormat

Description

A log output method that additionally performs a string format on the data being logged.

Declaration and definitions

#include "starboard/log.h"

void SbLogFormat(const char* /*format*/, va_list /*arguments*/) {
}

Parameters

SbLogFormatF

Description

Inline wrapper of SbLogFormat that converts from ellipsis to va_args.

Declaration

static SB_C_INLINE void SbLogFormatF(const char* format, ...)
    SB_PRINTF_FORMAT(1, 2);
void SbLogFormatF(const char* format, ...) {
  va_list args;
  va_start(args, format);
  SbLogFormat(format, args);
  va_end(args);
}

Parameters

SbLogIsTty

Description

Indicates whether the log output goes to a TTY or is being redirected.

Declaration and definitions

#include "starboard/log.h"

bool SbLogIsTty() {
  return false;
}

SbLogRaw

Description

A bare-bones log output method that is async-signal-safe, i.e. safe to call from an asynchronous signal handler (e.g. a SIGSEGV handler). It should not do any additional formatting.

Declaration and definitions

#include "starboard/log.h"

void SbLogRaw(const char* /*message*/) {
}

Parameters

SbLogRawDumpStack

Description

Dumps the stack of the current thread to the log in an async-signal-safe manner, i.e. safe to call from an asynchronous signal handler (e.g. a SIGSEGV handler). Does not include SbLogRawDumpStack itself.

Declaration and definitions

#include "starboard/log.h"

void SbLogRawDumpStack(int /*frames_to_skip*/) {
}

Parameters

SbLogRawFormat

Description

A formatted log output method that is async-signal-safe, i.e. safe to call from an asynchronous signal handler (e.g. a SIGSEGV handler).

Declaration and definitions

#include "starboard/log.h"

void SbLogRawFormat(const char* /*format*/, va_list /*arguments*/) {
}

Parameters

SbLogRawFormatF

Description

Inline wrapper of SbLogFormat to convert from ellipsis to va_args.

Declaration

static SB_C_INLINE void SbLogRawFormatF(const char* format, ...)
    SB_PRINTF_FORMAT(1, 2);
void SbLogRawFormatF(const char* format, ...) {
  va_list args;
  va_start(args, format);
  SbLogRawFormat(format, args);
  va_end(args);
}

Parameters

SetMinLogLevel

Declaration

SB_EXPORT void SetMinLogLevel(SbLogPriority level);

Parameters

causes

Declaration

// SB_EXPORT'd. Using SB_EXPORT here directly causes issues on Windows because
// it uses std classes which also need to be exported.
class LogMessage {
 public:
  LogMessage(const char* file, int line, SbLogPriority priority);

Parameters

count

Declaration

    static int count = 0;                                \
    if (0 == count++) {                                  \
      SbLog(kSbLogPriorityError, SB_NOTIMPLEMENTED_MSG); \
    }                                                    \
  } while (0)
#endif
#endif  // __cplusplus
#endif  // STARBOARD_LOG_H_

Parameters