28 lines
530 B
C#
28 lines
530 B
C#
using System;
|
|
using System.IO;
|
|
using UFS3.Management;
|
|
using UnityEngine;
|
|
|
|
public class PlayerLog : Singleton<PlayerLog>
|
|
{
|
|
private StreamWriter logWriter;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.gameObject.SetActive(value: false);
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
}
|
|
|
|
private void HandleLog(string logString, string stackTrace, LogType type)
|
|
{
|
|
logWriter.WriteLine($"[{DateTime.Now:HH:mm:ss}] {type}: {logString}");
|
|
if (type == LogType.Exception || type == LogType.Error)
|
|
{
|
|
logWriter.WriteLine(stackTrace);
|
|
}
|
|
}
|
|
}
|