We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


The WebGLRenderingContext.getShaderInfoLog returns the information log for the specified WebGLShader object. It contains warnings, debugging and compile information.




A WebGLShader to query.

Return value

A DOMString that contains diagnostic messages, warning messages, and other information about the last compile operation. When a WebGLShader object is initially created, its information log will be a string of length 0.


Checking compilation errors

/* load shader source code. */
gl.shaderSource(shader, shaderCode);

/* compile shader source code. */

var error = gl.getShaderInfoLog(shader);

if (error.length > 0) {
  throw error;


Specification Status Comment
WebGL 1.0
The definition of 'getShaderInfoLog' in that specification.
Recommendation Initial definition.
OpenGL ES 2.0
The definition of 'glGetShaderInfoLog' in that specification.
Standard Man page of the OpenGL API.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support912411125.1
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes25 Yes Yes128.1 Yes

See also

Document Tags and Contributors

Contributors to this page: fscholz, nmve, teoli, CzarSnow
Last updated by: fscholz,