Ejemplo n.º 1
0
    void ReportError()
    {
        _onGuiDisabled = true;
        StartCoroutine(_slack.CoPostScreenshot(
                           () => _onGuiDisabled = false,
                           "エラー報告",
                           null,
                           _errorReportChannel,
                           waitFrameCount: 1)); // 次のフレームでOnGUIで何もしない状態にしてから撮影
        var log = _logHandler.GetString();
        var sb  = new System.Text.StringBuilder();
        var now = System.DateTime.Now;

        sb.Append("----SystemInfo----\n");
        sb.AppendFormat("[ErrorLog] {0}\n", now.ToString("yyyy/MM/dd HH:mm:ss.fff"));
        sb.AppendFormat("device: {0} {1} {2} Memory:{3}\n", SystemInfo.deviceModel, SystemInfo.deviceName, SystemInfo.deviceType, SystemInfo.systemMemorySize);
        sb.AppendFormat("os: {0} {1}\n", SystemInfo.operatingSystem, SystemInfo.operatingSystemFamily);
        sb.AppendFormat("graphics: {0} {1} {2} Memory:{3}\n", SystemInfo.graphicsDeviceName, SystemInfo.graphicsDeviceType, SystemInfo.graphicsDeviceVersion, SystemInfo.graphicsMemorySize);
        sb.AppendFormat("processor: {0} core: {1} {2}MHz\n", SystemInfo.processorType, SystemInfo.processorCount, SystemInfo.processorFrequency);
        sb.AppendFormat("battery: {0}% {1}\n", SystemInfo.batteryLevel * 100f, SystemInfo.batteryStatus);
        sb.AppendFormat("shaderLevel: {0}\n", SystemInfo.graphicsShaderLevel);
        sb.AppendFormat("maxTextureSize: {0}\n", SystemInfo.maxTextureSize);
        sb.AppendFormat("nonPowerOfTwoSupport: {0}\n", SystemInfo.npotSupport);
#if UNITY_2018_1_OR_NEWER
        sb.AppendFormat("hasDynamicUniformArrayIndexingInFragmentShaders: {0}\n", SystemInfo.hasDynamicUniformArrayIndexingInFragmentShaders);
        sb.AppendFormat("supports32bitsIndexBuffer: {0}\n", SystemInfo.supports32bitsIndexBuffer);
#endif
        sb.Append("----SceneInfo----\n");
        for (int i = 0; i < UnityEngine.SceneManagement.SceneManager.sceneCount; i++)
        {
            sb.AppendFormat("{0}\n", UnityEngine.SceneManagement.SceneManager.GetSceneAt(i).name);
        }
        sb.Append("----Log----\n");
        var bytes = System.Text.Encoding.UTF8.GetBytes(sb.ToString() + log);
        StartCoroutine(_slack.CoPostBinary(
                           bytes,
                           "errorLog" + now.ToString("yyyy_MM_dd__HH_mm_ss_fff") + ".txt",
                           null,
                           null,
                           _errorReportChannel));
    }
Ejemplo n.º 2
0
 public void OnClickSendLogButton()
 {
     StartCoroutine(_slack.CoPostBinary(_log.GetBytes(), "log.txt"));
 }