diff --git a/.clang-format b/.clang-format index 9c5be3de4..9b4c96aa5 100644 --- a/.clang-format +++ b/.clang-format @@ -30,3 +30,6 @@ AccessModifierOffset: -2 # TODO(jmadill): Decide if we want this on. Doesn't have an "all or none" mode. AllowShortCaseLabelsOnASingleLine: false + +# Useful for spacing out functions in classes +KeepEmptyLinesAtTheStartOfBlocks: true diff --git a/include/platform/Platform.h b/include/platform/Platform.h index c5aa71bf3..4225ca0fc 100644 --- a/include/platform/Platform.h +++ b/include/platform/Platform.h @@ -31,6 +31,17 @@ class Platform // it is recommended that the fixed point be no further in the past than the epoch. virtual double monotonicallyIncreasingTime() { return 0; } + // Logging ------------------------------------------------------------ + + // Log an error message within the platform implementation. + virtual void logError(const char *errorMessage) {} + + // Log a warning message within the platform implementation. + virtual void logWarning(const char *warningMessage) {} + + // Log an info message within the platform implementation. + virtual void logInfo(const char *infoMessage) {} + // Tracing -------- // Get a pointer to the enabled state of the given trace category. The diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp index 208bbcd96..1817d3b24 100644 --- a/src/libANGLE/Display.cpp +++ b/src/libANGLE/Display.cpp @@ -255,6 +255,11 @@ Error Display::initialize() Error error = mImplementation->initialize(this); if (error.isError()) { + // Log extended error message here + std::stringstream errorStream; + errorStream << "ANGLE Display::initialize error " << error.getID() << ": " + << error.getMessage(); + ANGLEPlatformCurrent()->logError(errorStream.str().c_str()); return error; }