(client) feat:Add logging module
This commit is contained in:
8
Client/Assets/Plugins.meta
Normal file
8
Client/Assets/Plugins.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c63492604b114b743bfd3101f5aad2ee
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Client/Assets/Plugins/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
BIN
Client/Assets/Plugins/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cbf29d2dbaa0d5e4cbbfe81e0695699f
|
BIN
Client/Assets/Plugins/Serilog.Sinks.File.dll
Normal file
BIN
Client/Assets/Plugins/Serilog.Sinks.File.dll
Normal file
Binary file not shown.
2
Client/Assets/Plugins/Serilog.Sinks.File.dll.meta
Normal file
2
Client/Assets/Plugins/Serilog.Sinks.File.dll.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3ddd12c9ec493d44b869a1a0f96b229
|
BIN
Client/Assets/Plugins/Serilog.dll
Normal file
BIN
Client/Assets/Plugins/Serilog.dll
Normal file
Binary file not shown.
2
Client/Assets/Plugins/Serilog.dll.meta
Normal file
2
Client/Assets/Plugins/Serilog.dll.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: be71603d4816e6f46ba3e3e3521807ce
|
BIN
Client/Assets/Plugins/System.Diagnostics.DiagnosticSource.dll
Normal file
BIN
Client/Assets/Plugins/System.Diagnostics.DiagnosticSource.dll
Normal file
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3e86ef7ea165f2b49afd65112a76e62e
|
BIN
Client/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll
Normal file
BIN
Client/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll
Normal file
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3068cec879382a49b76e67bfe61e6a2
|
BIN
Client/Assets/Plugins/System.Threading.Channels.dll
Normal file
BIN
Client/Assets/Plugins/System.Threading.Channels.dll
Normal file
Binary file not shown.
2
Client/Assets/Plugins/System.Threading.Channels.dll.meta
Normal file
2
Client/Assets/Plugins/System.Threading.Channels.dll.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 15f29a461121df44dbaa93fd319c908e
|
@ -38,12 +38,12 @@ RenderSettings:
|
|||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 0}
|
m_Sun: {fileID: 0}
|
||||||
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
|
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 12
|
serializedVersion: 13
|
||||||
|
m_BakeOnSceneLoad: 0
|
||||||
m_GISettings:
|
m_GISettings:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_BounceScale: 1
|
m_BounceScale: 1
|
||||||
@ -250,12 +250,12 @@ MonoBehaviour:
|
|||||||
m_RequiresColorTexture: 0
|
m_RequiresColorTexture: 0
|
||||||
m_Version: 2
|
m_Version: 2
|
||||||
m_TaaSettings:
|
m_TaaSettings:
|
||||||
quality: 3
|
m_Quality: 3
|
||||||
frameInfluence: 0.1
|
m_FrameInfluence: 0.1
|
||||||
jitterScale: 1
|
m_JitterScale: 1
|
||||||
mipBias: 0
|
m_MipBias: 0
|
||||||
varianceClampScale: 0.9
|
m_VarianceClampScale: 0.9
|
||||||
contrastAdaptiveSharpening: 0
|
m_ContrastAdaptiveSharpening: 0
|
||||||
--- !u!1 &410087039
|
--- !u!1 &410087039
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -336,6 +336,9 @@ Light:
|
|||||||
m_ForceVisible: 0
|
m_ForceVisible: 0
|
||||||
m_ShadowRadius: 0
|
m_ShadowRadius: 0
|
||||||
m_ShadowAngle: 0
|
m_ShadowAngle: 0
|
||||||
|
m_LightUnit: 1
|
||||||
|
m_LuxAtDistance: 1
|
||||||
|
m_EnableSpotReflector: 1
|
||||||
--- !u!4 &410087041
|
--- !u!4 &410087041
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -374,6 +377,50 @@ MonoBehaviour:
|
|||||||
m_LightCookieSize: {x: 1, y: 1}
|
m_LightCookieSize: {x: 1, y: 1}
|
||||||
m_LightCookieOffset: {x: 0, y: 0}
|
m_LightCookieOffset: {x: 0, y: 0}
|
||||||
m_SoftShadowQuality: 1
|
m_SoftShadowQuality: 1
|
||||||
|
--- !u!1 &436334521
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 436334523}
|
||||||
|
- component: {fileID: 436334522}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: EntryPoint
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &436334522
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 436334521}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: b87e0a61112e899429b941b1dcb30018, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!4 &436334523
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 436334521}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: -0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &832575517
|
--- !u!1 &832575517
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -427,6 +474,7 @@ Transform:
|
|||||||
SceneRoots:
|
SceneRoots:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_Roots:
|
m_Roots:
|
||||||
|
- {fileID: 436334523}
|
||||||
- {fileID: 330585546}
|
- {fileID: 330585546}
|
||||||
- {fileID: 410087041}
|
- {fileID: 410087041}
|
||||||
- {fileID: 832575519}
|
- {fileID: 832575519}
|
||||||
|
8
Client/Assets/Scripts.meta
Normal file
8
Client/Assets/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7b32d4e00d171e34586a8738a0249b38
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Client/Assets/Scripts/Logging.meta
Normal file
8
Client/Assets/Scripts/Logging.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 33ad57cd610a4524f85d6f149cb2e15b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
55
Client/Assets/Scripts/Logging/UnityLogger.cs
Normal file
55
Client/Assets/Scripts/Logging/UnityLogger.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
using Serilog;
|
||||||
|
using UnityEngine;
|
||||||
|
using SerilogLogger = Serilog.Core.Logger;
|
||||||
|
|
||||||
|
namespace Logging
|
||||||
|
{
|
||||||
|
public static class UnityLogger
|
||||||
|
{
|
||||||
|
private static readonly SerilogLogger Logger = new LoggerConfiguration()
|
||||||
|
.WriteTo.File("Logs/UnityLog.txt")
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
Application.logMessageReceived += OnLogMessageReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void OnLogMessageReceived(string logString, string stackTrace, LogType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case LogType.Assert:
|
||||||
|
{
|
||||||
|
Logger.Warning("\nContent: {0}", logString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LogType.Log:
|
||||||
|
{
|
||||||
|
Logger.Information("\nContent: {0}", logString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LogType.Warning:
|
||||||
|
{
|
||||||
|
Logger.Warning("\nContent: {0}", logString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LogType.Error:
|
||||||
|
{
|
||||||
|
Logger.Error("\nContent: {0}\nStackTrace:\n{1}", logString, stackTrace[..^1]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LogType.Exception:
|
||||||
|
{
|
||||||
|
Logger.Fatal("\nContent: {0}\nStackTrace:\n{1}", logString, stackTrace[..^1]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
Logger.Information("\nContent: {0}", logString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
Client/Assets/Scripts/Logging/UnityLogger.cs.meta
Normal file
2
Client/Assets/Scripts/Logging/UnityLogger.cs.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e3e33084c3687c348bd4c26c8a42fd0e
|
15
Client/Assets/Scripts/Program.cs
Normal file
15
Client/Assets/Scripts/Program.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Logging;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Program : MonoBehaviour
|
||||||
|
{
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
UnityLogger.Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
Debug.Log("Starting game...");
|
||||||
|
}
|
||||||
|
}
|
2
Client/Assets/Scripts/Program.cs.meta
Normal file
2
Client/Assets/Scripts/Program.cs.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b87e0a61112e899429b941b1dcb30018
|
121
Client/ProjectSettings/SceneTemplateSettings.json
Normal file
121
Client/ProjectSettings/SceneTemplateSettings.json
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
{
|
||||||
|
"templatePinStates": [],
|
||||||
|
"dependencyTypeInfos": [
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.AnimationClip",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEditor.Animations.AnimatorController",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.AnimatorOverrideController",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEditor.Audio.AudioMixerController",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.ComputeShader",
|
||||||
|
"defaultInstantiationMode": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Cubemap",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.GameObject",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEditor.LightingDataAsset",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.LightingSettings",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Material",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEditor.MonoScript",
|
||||||
|
"defaultInstantiationMode": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.PhysicsMaterial",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.PhysicsMaterial2D",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Rendering.PostProcessing.PostProcessResources",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Rendering.VolumeProfile",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEditor.SceneAsset",
|
||||||
|
"defaultInstantiationMode": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Shader",
|
||||||
|
"defaultInstantiationMode": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.ShaderVariantCollection",
|
||||||
|
"defaultInstantiationMode": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Texture",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Texture2D",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "UnityEngine.Timeline.TimelineAsset",
|
||||||
|
"defaultInstantiationMode": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"defaultDependencyTypeInfo": {
|
||||||
|
"userAdded": false,
|
||||||
|
"type": "<default_scene_template_dependencies>",
|
||||||
|
"defaultInstantiationMode": 1
|
||||||
|
},
|
||||||
|
"newSceneOverride": 0
|
||||||
|
}
|
Reference in New Issue
Block a user