Skip to content

Commit

Permalink
[gl] Improved logging options in expo-gl (#7550)
Browse files Browse the repository at this point in the history
# Why

#7502 reminded me that we should have better logging/debugging options for `expo-gl` as we don't log anything by default and, most importantly, we don't log any errors like all web browsers do.

# How

- Removed `gl.enableLogging` -> it isn't a part of WebGL specification so imho it should somehow indicate itself as Expo-specific. We don't need to deprecate it first as it wasn't documented.
- Added `gl.__expoSetLogging` method which receives bitwise enum `GLLoggingOption` (check out tsdoc comments for more details).
- Moved the code responsible for logging to separate file (called `GLUtils`, because I believe we can put more stuff there soon).
- Slightly improved how WebGL objects are being stringified by us. Some of them were being logged as `[object Object]`.
- Added a few missing TypeScript property declarations.

# Test Plan

Tested by adding `gl.__expoSetLogging` method call to NCL example and playing with some custom `GLLoggingOption` values.
  • Loading branch information
tsapeta committed Apr 9, 2020
1 parent 6236b01 commit 3200409
Show file tree
Hide file tree
Showing 18 changed files with 338 additions and 77 deletions.
2 changes: 2 additions & 0 deletions packages/expo-gl/CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@

### 🎉 New features

- Improved logging and added some more logging options. ([#7550](https://github.com/expo/expo/pull/7550) by [@tsapeta](https://github.com/tsapeta))

### 🐛 Bug fixes

- Fix depth/stencil buffers not working correctly with `three.js`. ([#7543](https://github.com/expo/expo/pull/7543) by [@tsapeta](https://github.com/tsapeta))
9 changes: 9 additions & 0 deletions packages/expo-gl/build/GLErrors.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/expo-gl/build/GLErrors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/expo-gl/build/GLErrors.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/expo-gl/build/GLUtils.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions packages/expo-gl/build/GLUtils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/expo-gl/build/GLUtils.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 12 additions & 37 deletions packages/expo-gl/build/GLView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-gl/build/GLView.js.map

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions packages/expo-gl/build/GLView.types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions packages/expo-gl/build/GLView.types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3200409

Please sign in to comment.