-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
60 lines (40 loc) · 1.32 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
title: "WebGLRenderingContext: getProgramInfoLog() method"
short-title: getProgramInfoLog()
slug: Web/API/WebGLRenderingContext/getProgramInfoLog
page-type: web-api-instance-method
browser-compat: api.WebGLRenderingContext.getProgramInfoLog
---
{{APIRef("WebGL")}}
The **WebGLRenderingContext.getProgramInfoLog** returns the information
log for the specified {{domxref("WebGLProgram")}} object. It contains errors that
occurred during failed linking or validation of `WebGLProgram` objects.
## Syntax
```js-nolint
getProgramInfoLog(program)
```
### Parameters
- `program`
- : The {{domxref("WebGLProgram")}} to query.
### Return value
A string that contains diagnostic messages, warning messages, and
other information about the last linking or validation operation. When a
{{domxref("WebGLProgram")}} object is initially created, its information log will be a
string of length 0.
## Examples
### Checking program errors
```js
const program = gl.createProgram();
// Attach pre-existing shaders
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
gl.getProgramInfoLog(program);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("WebGLRenderingContext.getShaderInfoLog()")}}
- {{domxref("WebGLRenderingContext.getError()")}}