Skip to content

Commit 3d95662

Browse files
Merge pull request #19317 from ndesai-newrelic/develop
added Unity example for logs
2 parents 640f46f + 3d31ddd commit 3d95662

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

src/content/docs/mobile-monitoring/mobile-monitoring-ui/mobile-logs.mdx

+50-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ Keep in mind that when you use the logging APIs, you should only use the debug l
7373
</TabsBarItem>
7474
<TabsBarItem id="xamarin">
7575
Xamarin
76+
</TabsBarItem>
77+
<TabsBarItem id="Unity">
78+
Unity
7679
</TabsBarItem>
7780
<TabsBarItem id="unreal">
7881
Unreal
@@ -600,13 +603,57 @@ CrossNewRelicClient.Current.LogAttributes(new Dictionary<string, object>()
600603
{ "message", "This is a message with attributes" }
601604
}
602605
);
606+
```
607+
</TabsPageItem>
608+
<TabsPageItem id="Unity">
609+
### Syntax [#syntax]
610+
611+
```csharp
612+
NewRelicAgent.LogInfo(String message) : void
613+
614+
NewRelicAgent.LogError(String message) : void
615+
616+
NewRelicAgent.LogVerbose(String message) : void
617+
618+
NewRelicAgent.LogWarning(String message) : void
619+
620+
NewRelicAgent.LogDebug(String message) : void
621+
622+
NewRelicAgent.Log(LogLevel level, String message) : void
623+
624+
NewRelicAgent.LogAttributes(Dictionary<string, object> attributes) : void
603625
```
604626

605-
</TabsPageItem>
606627

607-
<TabsPageItem id="unreal">
628+
### Example [#example]
629+
630+
```csharp
631+
NewRelicAgent.LogInfo("This is an informational message");
632+
633+
NewRelicAgent.LogError("This is an error message");
634+
635+
NewRelicAgent.LogVerbose("This is a verbose message");
636+
637+
NewRelicAgent.LogWarning("This is a warning message");
638+
639+
NewRelicAgent.LogDebug("This is a debug message");
608640

609-
### Syntax [#syntax]
641+
NewRelicAgent.Log(LogLevel.Info, "This is an informational message");
642+
643+
NewRelicAgent.LogAttributes(new Dictionary<string, object>()
644+
{
645+
{"BreadNumValue", 12.3 },
646+
{"BreadStrValue", "UnityBread" },
647+
{"BreadBoolValue", true },
648+
{"message", "This is a message with attributes" }
649+
}
650+
);
651+
```
652+
</TabsPageItem>
653+
654+
<TabsPageItem id="unreal">
655+
656+
### Syntax [#syntax]
610657

611658
```c
612659
UNewRelicBPLibrary::logInfo(FString message) : void

0 commit comments

Comments
 (0)