mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-01 07:25:51 +00:00
more sentry context
This commit is contained in:
parent
cd80acdc7d
commit
113f25dab8
@ -44,6 +44,7 @@ import com.volmit.iris.core.safeguard.UtilsSFG;
|
||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.context.IrisContext;
|
||||
import com.volmit.iris.util.exceptions.IrisException;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
@ -963,6 +964,8 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
options.setBeforeSend((event, hint) -> {
|
||||
event.setTag("iris.safeguard", IrisSafeguard.mode());
|
||||
event.setTag("iris.nms", INMS.get().getClass().getCanonicalName());
|
||||
var context = IrisContext.get();
|
||||
if (context != null) event.getContexts().set("engine", context.asContext());
|
||||
return event;
|
||||
});
|
||||
});
|
||||
|
@ -26,6 +26,7 @@ import com.volmit.iris.core.tools.IrisPackBenchmarking;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.util.context.IrisContext;
|
||||
import com.volmit.iris.util.decree.DecreeExecutor;
|
||||
import com.volmit.iris.util.decree.DecreeOrigin;
|
||||
import com.volmit.iris.util.decree.annotations.Decree;
|
||||
@ -73,6 +74,8 @@ public class CommandDeveloper implements DecreeExecutor {
|
||||
|
||||
@Decree(description = "Send a test exception to sentry")
|
||||
public void Sentry() {
|
||||
Engine engine = engine();
|
||||
if (engine != null) IrisContext.getOr(engine);
|
||||
Iris.reportError(new Exception("This is a test"));
|
||||
}
|
||||
|
||||
|
@ -87,4 +87,21 @@ public class IrisContext {
|
||||
public IrisComplex getComplex() {
|
||||
return engine.getComplex();
|
||||
}
|
||||
|
||||
public KMap<String, Object> asContext() {
|
||||
var hash32 = engine.getHash32().getNow(null);
|
||||
var dimension = engine.getDimension();
|
||||
var mantle = engine.getMantle();
|
||||
return new KMap<String, Object>()
|
||||
.qput("studio", engine.isStudio())
|
||||
.qput("closed", engine.isClosed())
|
||||
.qput("pack", new KMap<>()
|
||||
.qput("key", dimension.getLoadKey())
|
||||
.qput("version", dimension.getVersion())
|
||||
.qput("hash", hash32 == null ? "" : Long.toHexString(hash32)))
|
||||
.qput("mantle", new KMap<>()
|
||||
.qput("idle", mantle.getAdjustedIdleDuration())
|
||||
.qput("loaded", mantle.getLoadedRegionCount())
|
||||
.qput("queued", mantle.getUnloadRegionCount()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user