log: add basic utility to log to editor from native plugin
2 unresolved threads
2 unresolved threads
Need to clarify the various logging things:
- libvlcsharp logs (to Unity Editor console or stdout),
- libvlc logs (
_libVLC.Log += (s, e) => UnityEngine.Debug.Log(e.FormattedLog);
) - now in-editor vlc plugin logs.
components that may want to publish logs:
- unity users script,
- libvlcsharp,
- vlc unity plugin,
- libvlc.
possible outputs:
- Unity Editor Log Console
- stdout,
- log file.
solution:
- register a log callback from
UnityEngine.Debug.Log
from the vlc-unity c# initialization script to the C++ vlc unity plugin. - expose log functions from the vlc-unity plugin (one for logging to the Unity Editor, another to log to stdout).
- have libvlcsharp call into either of the exposed log functions (notably when an exception is thrown from a reverse callback).
https://blog.sentry.io/unity-exception-handling-a-beginners-guide/
I guess the user could want:
- to subscribe all logs in a single call,
- to selectively subscribe to some logs,
- to send the libvlc logs to the editor and to send the vlc plugin logs to a file?
- unity editor log color support, enable/disable
Edited by Martin Finkel
Merge request reports
Activity
Filter activity
11 12 const int seekTimeDelta = 5000; 12 13 Texture2D tex = null; 13 14 bool playing; 14 15 16 [DllImport("VLCUnityPlugin", CallingConvention = CallingConvention.Cdecl)] 17 static extern void RegisterDebugCallback(debugCallback cb); changed this line in version 3 of the diff
22 static void OnDebugCallback(IntPtr request, int color, int size) 23 { 24 //Ptr to string 25 string debug_string = Marshal.PtrToStringAnsi(request, size); 26 27 //Add Specified Color 28 debug_string = 29 String.Format("{0}{1}{2}{3}{4}", 30 "<color=", 31 ((Color)color).ToString(), 32 ">", 33 debug_string, 34 "</color>" 35 ); 36 37 UnityEngine.Debug.Log(debug_string); changed this line in version 3 of the diff
This MR is needed to partly provide a fix to #131 (closed) (with some more code that uses it from libvlcsharp)
added 26 commits
-
7a8c1801...63493672 - 25 commits from branch
videolan:master
- f1bffa7c - log: add basic utility to log to editor from native plugin
-
7a8c1801...63493672 - 25 commits from branch
mentioned in merge request !44 (merged)
added 16 commits
-
f1bffa7c...f5506f61 - 15 commits from branch
videolan:master
- 16e54f41 - log: add basic utility to log to editor from native plugin
-
f1bffa7c...f5506f61 - 15 commits from branch
added 12 commits
-
16e54f41...b6f65bef - 11 commits from branch
videolan:master
- 99727c68 - log: add basic utility to log to editor from native plugin
-
16e54f41...b6f65bef - 11 commits from branch
added 2 commits