-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Logging | ||
|
||
To debug the application, it is useful to enable logging. | ||
|
||
By default, the plugin outputs INFO level logs.\ | ||
You can change the log level at runtime as follows: | ||
|
||
```cs | ||
Mediapipe.Unity.Logger.MinLogLevel = Logger.LogLevel.Debug; | ||
``` | ||
|
||
Additionally, MediaPipe uses [Google Logging Library(glog)](https://github.com/google/glog) internally.\ | ||
You can configure it by [setting flags](https://github.com/google/glog#setting-flags). | ||
|
||
```cs | ||
Glog.Logtostderr = true; // when true, log will be output to `Editor.log` / `Player.log` | ||
Glog.Minloglevel = 0; // output INFO logs | ||
Glog.V = 3; // output more verbose logs | ||
``` | ||
|
||
To enable those flags, call `Glog.Initialize` when the application starts. | ||
|
||
```cs | ||
Glog.Initialize("MediaPipeUnityPlugin"); | ||
``` | ||
|
||
> :skull_and_crossbones: `Glog.Initialize` can be called only once. The second call will crash your application or UnityEditor. | ||
> :bulb: If you look closely at `Editor.log`, you will notice the following warning log output.\ | ||
> | ||
> ```txt | ||
> WARNING: Logging before InitGoogleLogging() is written to STDERR | ||
> ``` | ||
> | ||
> To suppress it, you need to call `Glog.Initialize`.\ | ||
> However, without setting `true` to `Glog.Logtostderr`, glog won't output to `Editor.log` / `Player.log`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Contents | ||
|
||
- [Build](Build.md) | ||
- [Logging](Logging.md) | ||
|
||
## Tutorials | ||
|
||
- [Tutorial - Task API](Tutorial-Task-API.md) | ||
- [Tutorial - Hello World!](Tutorial-Hello-World.md) | ||
- [Tutorial - Custom Graph](Tutorial-Custom-Graph.md) | ||
|
||
## API Reference | ||
|
||
:construction: Under construction |