Skip to content

Examples

Thev2Andy edited this page Mar 22, 2024 · 9 revisions

Examples

Important

The wiki is no longer being maintained, and is now kept as historical reference. (And will be removed in the future.)

Simple LogSample

using System;
using PowerLog; // Don't forget to import the DLL.

namespace LogSample
{
    class Program
    {
        static void Main(string[] args)
        {
            Logger.OnLog += OnLog;
            LogSession.WriteInLogFile = true;
            LogSession.LogSizeThreshold = 5000000;
            LogSession.Initialize();

            Log:
            Logger.Log("Hello PowerLog!", LogType.Null, false, false, true, null);
            System.Threading.Tasks.Task.Delay(1);

            goto Log;
        }

        public static void OnLog(object Sender, LogEventArgs LogArgs)
        {
            Console.WriteLine(LogArgs.LogMessage);
        }
    }
}

More examples coming soon!

Clone this wiki locally