Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 1.4.1 #30

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.4.1


## Improvements

- Native Android agent updated to version 7.6.0
- Native iOS agent updated to version 7.5.2
- Bug fixes for Log Attributes method

## 1.4.0

## New Features
Expand Down
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ In your Unity IDE, click Tools → NewRelic → Getting Started to open the NewR
dependencies {
implementation project(':unityLibrary')
implementation 'com.newrelic.agent.android:agent-ndk:1.+'
implementation 'com.newrelic.agent.android:android-agent:7.2.0'
implementation 'com.newrelic.agent.android:android-agent:7.5.0'
}

android {
Expand Down Expand Up @@ -89,7 +89,7 @@ android {
// See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
// See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go to "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
classpath 'com.newrelic.agent.android:agent-gradle-plugin:7.3.0'
classpath 'com.newrelic.agent.android:agent-gradle-plugin:7.5.0'
**BUILD_SCRIPT_DEPS**
}
}
Expand Down Expand Up @@ -273,8 +273,54 @@ See the examples below, and for more detail, see [New Relic IOS SDK doc](https:/
NewRelicAgent.setMaxOfflineStorageSize(200);
```

### LogInfo(String message) : void

> Logs an informational message to the New Relic log.
``` C#
NewRelicAgent.LogInfo("This is an informational message");
```

### LogError(String message) : void
> Logs an error message to the New Relic log.
``` C#
NewRelicAgent.LogError("This is an error message");
```
### LogVerbose(String message) : void
> Logs a verbose message to the New Relic log.
``` C#
NewRelicAgent.LogVerbose("This is a verbose message");
```

### LogWarning(String message) : void
> Logs a warning message to the New Relic log.
``` C#
NewRelicAgent.LogWarning("This is a warning message");
```

### LogDebug(String message) : void
> Logs a debug message to the New Relic log.
``` C#
NewRelicAgent.LogDebug("This is a debug message");
```

### Log(NewRelicAgent.AgentLogLevel level, String message) : void
> Logs a message to the New Relic log with a specified log level.
``` C#
NewRelicAgent.LogNewRelic.NewRelicAgent.AgentLogLevel.INFO, "This is an informational message");
```

### LogAttributes(Dictionary<string, object> attributes) : void
> Logs a message with attributes to the New Relic log.
``` C#
NewRelicAgent.LogAttributes(new Dictionary<string, object>()
{
{"BreadNumValue", 12.3 },
{"BreadStrValue", "UnityBread" },
{"BreadBoolValue", true },
{"message", "This is a message with attributes" }
}
);
```

## How to see C# Errors(Fatal/Non Fatal) in NewRelic One?

Expand Down
6 changes: 3 additions & 3 deletions com.newrelic.agent/Editor/TestUnityDependencies.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<dependencies>
<androidPackages>
<androidPackage spec="com.newrelic.agent.android:agent-ndk:1.+"></androidPackage>
<androidPackage spec="com.newrelic.agent.android:android-agent:7.5.+">
<androidPackage spec="com.newrelic.agent.android:agent-ndk:1.1.2"></androidPackage>
<androidPackage spec="com.newrelic.agent.android:android-agent:7.6.0">
</androidPackage>
</androidPackages>
<iosPods>
<iosPod name="NewRelicAgent" version="~> 7.5.0" minTargetSdk="11.0">
<iosPod name="NewRelicAgent" version="~> 7.5.2" minTargetSdk="11.0">
<sources>
<source>https://github.com/CocoaPods/Specs</source>
</sources>
Expand Down
45 changes: 44 additions & 1 deletion com.newrelic.agent/Scripts/NewRelicAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Threading;
using UnityEngine.SceneManagement;
using System.Collections;
#if UNITY_IPHONE || UNITY_ANDROID
using NewRelic.Native;
#endif
Expand Down Expand Up @@ -749,7 +750,7 @@ static public void NoticeNetworkFailure(string url,
{
if (validatePluginImpl())
{
instance.agentInstance.noticeNetworkFailure(url, httpMethod, startTime,endTime, failureCode, message);
instance.agentInstance.noticeNetworkFailure(url, httpMethod, startTime, endTime, failureCode, message);
}
}

Expand Down Expand Up @@ -1041,10 +1042,13 @@ static public void Log(NewRelicAgent.AgentLogLevel level, String message)
{
if (validatePluginImpl())
{
String logLevel = LogLevelString(level);
instance.agentInstance.Log(level, message);
}
}



/// <summary>
/// Logs a set of attributes.
/// </summary>
Expand All @@ -1053,11 +1057,50 @@ static public void LogAttributes(Dictionary<string, object> attributes)
{
if (validatePluginImpl())
{



if ((attributes.ContainsKey("level") && attributes.GetValueOrDefault("level").GetType() == typeof(AgentLogLevel)))
{
attributes["level"] = LogLevelString((AgentLogLevel)attributes.GetValueOrDefault("level"));
}



instance.agentInstance.LogAttributes(attributes);
}
}


public static String LogLevelString(AgentLogLevel agentLogLevel)
{

String logLevel = "INFO";

if (agentLogLevel.Equals(AgentLogLevel.DEBUG))
{
logLevel = "DEBUG";
}
else if (agentLogLevel.Equals(AgentLogLevel.ERROR))
{
logLevel = "ERROR";
}
else if (agentLogLevel.Equals(AgentLogLevel.INFO))
{
logLevel = "INFO";
}
else if (agentLogLevel.Equals(AgentLogLevel.VERBOSE))
{
logLevel = "VERBOSE";
}
else if (agentLogLevel.Equals(AgentLogLevel.WARNING))
{
logLevel = "WARN";
}



return logLevel;
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.newrelic.agent",
"version": "1.4.0",
"version": "1.4.1",
"displayName": "NewRelic SDK",
"description": "NewRelic's Unity SDK lets you bring the deep, introspective and native debugging power of NewRelic into your Unity game or application.",
"unity": "2019.1",
Expand Down
Loading