diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index 91121e0a8..adc004d7f 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -2172,18 +2172,26 @@ void Program::PerContextProgram::linkProgram() _isLinked = (linked == GL_TRUE); if( ! _isLinked ) { - osg::notify(osg::WARN) << "glLinkProgram \"" - << _program->getName() << "\" FAILED" << std::endl; + osg::notify(osg::WARN) << "glLinkProgram \""<< _program->getName() << "\" FAILED" << std::endl; std::string infoLog; if( getInfoLog(infoLog) ) { - osg::notify(osg::WARN) << "Program \"" - << _program->getName() << "\" infolog:\n" << infoLog << std::endl; + osg::notify(osg::WARN) << "Program \""<< _program->getName() << "\" " + "infolog:\n" << infoLog << std::endl; } return; } + else + { + std::string infoLog; + if( getInfoLog(infoLog) ) + { + osg::notify(osg::INFO) << "Program \""<< _program->getName() << "\" "<< + "link succeded, infolog:\n" << infoLog << std::endl; + } + } // build _uniformInfoMap GLint numUniforms = 0; diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 2499073ce..747225fda 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -326,14 +326,24 @@ void Shader::PerContextShader::compileShader() { osg::notify(osg::WARN) << _shader->getTypename() << " glCompileShader \"" << _shader->getName() << "\" FAILED" << std::endl; + + std::string infoLog; + if( getInfoLog(infoLog) ) + { + osg::notify(osg::WARN) << _shader->getTypename() << " Shader \"" + << _shader->getName() << "\" infolog:\n" << infoLog << std::endl; + } + } + else + { + std::string infoLog; + if( getInfoLog(infoLog) ) + { + osg::notify(osg::INFO) << _shader->getTypename() << " Shader \"" + << _shader->getName() << "\" infolog:\n" << infoLog << std::endl; + } } - std::string infoLog; - if( getInfoLog(infoLog) ) - { - osg::notify(osg::INFO) << _shader->getTypename() << " Shader \"" - << _shader->getName() << "\" infolog:\n" << infoLog << std::endl; - } } bool Shader::PerContextShader::getInfoLog( std::string& infoLog ) const