MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / Initialize

Method Initialize

Examples/StereoKitTest/Docs/DocDebug.cs:6–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4class DocDebug : ITest
5{
6 public void Initialize()
7 {
8 /// :CodeSample: Log.Filter
9 /// Show everything that StereoKit logs!
10 Log.Filter = LogLevel.Diagnostic;
11 /// Or, only show warnings and errors:
12 Log.Filter = LogLevel.Warning;
13 /// :End:
14 Log.Filter = LogLevel.Diagnostic;
15
16 /// :CodeSample: Log.Write
17 Log.Write(LogLevel.Info, "<~grn>{0:0.0}s<~clr> have elapsed since StereoKit start.", Time.Total);
18 /// :End:
19
20 /// :CodeSample: Log.Info
21 Log.Info("<~grn>{0:0.0}s<~clr> have elapsed since StereoKit start.", Time.Total);
22 /// :End:
23
24 /// :CodeSample: Log.Warn
25 Log.Warn("Warning! <~ylw>{0:0.0}s<~clr> have elapsed since StereoKit start!", Time.Total);
26 /// :End:
27
28 /// :CodeSample: Log.Err
29 if (Time.Stepf > 0.017f)
30 Log.Err("Oh no! Frame time (<~red>{0}<~clr>) has exceeded 17ms! There's no way we'll hit even 60 frames per second!", Time.Stepf);
31 /// :End:
32
33 /// :CodeSample: Log.Unsubscribe
34 LogCallback onLog = (LogLevel level, string logText)
35 => Console.WriteLine(logText);
36
37 Log.Subscribe(onLog);
38 /// ...
39 Log.Unsubscribe(onLog);
40 /// :End:
41 }
42
43 public void Shutdown(){}
44 public void Step (){}

Callers

nothing calls this directly

Calls 6

WriteMethod · 0.80
InfoMethod · 0.80
WarnMethod · 0.80
ErrMethod · 0.80
SubscribeMethod · 0.45
UnsubscribeMethod · 0.45

Tested by

no test coverage detected