Created
April 21, 2020 14:35
-
-
Save MuhammadFaizanKhan/74b6bea553619d3dbbd9774dbdaaae21 to your computer and use it in GitHub Desktop.
How to use Serilog in Unity3d C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using Serilog;//Need dll files | |
public class SerilogDemoInUnity3d : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ | |
var log = new LoggerConfiguration().WriteTo.File(Application.dataPath + "/AppLog.txt").CreateLogger(); | |
//global logger settings | |
Log.Logger = log; | |
//some logs | |
Log.Information("Here is the Information"); | |
Log.Warning("Here is warning"); | |
Log.Error("Here is an error"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment