/*
 *  public void TestLoggingSystem() {
 *    Log.C(this, "here is a critical log... Yay!");
 *    Log.D(this, "Here is a debig log");
 *
 *    try {
 *      throw new Exception("TestException");
 *    } catch (Exception e) {
 *      Log.E(this, "An expected exception occurred", e);
 *    }
 *
 *    Log.M(this, "here is a metric");
 *    Log.V(this, "Verboseness");
 *
 *    Log.UploadLogs();
 *  }
 */

        private void SaveSystemInfo(Java.IO.File dest)
        {
            if (AppState.context == null)
            {
                return;
            }
            try {
                var fn   = "SystemInfo.txt";
                var file = new Java.IO.File(dest, fn);

                var dump = new BaseAppDump(AppState.context);

                using (var w = new StreamWriter(new FileStream(file.AbsolutePath, FileMode.OpenOrCreate))) {
                    w.Write(dump.ToString());
                }
            } catch (Exception e) {
                Print(new LogData(Log.Level.Error, TAG, "Failed to save system info", e));
            }
        }
示例#2
0
/*
 *  public void TestLoggingSystem() {
 *    Log.C(this, "here is a critical log... Yay!");
 *    Log.D(this, "Here is a debig log");
 *
 *    try {
 *      throw new Exception("TestException");
 *    } catch (Exception e) {
 *      Log.E(this, "An expected exception occurred", e);
 *    }
 *
 *    Log.M(this, "here is a metric");
 *    Log.V(this, "Verboseness");
 *
 *    Log.UploadLogs();
 *  }
 */

        private void SaveSystemInfo(string dest)
        {
            if (AppState.context == null)
            {
                return;
            }

            try {
                var fn   = "SystemInfo.txt";
                var file = Path.Combine(dest, fn);

                var dump = new BaseAppDump(AppState.context);

                using (var w = new StreamWriter(new FileStream(file, FileMode.OpenOrCreate))) {
                    w.Write(dump.ToString());
                }
            } catch (Exception e) {
                Print(TAG, "Failed to save system info", e);
            }
        }