Example #1
0
    public Test Logs()
    {
        var p = new PerfLog();

        p.Start();

        Log.D("Debug--");
        Log.I("Info--");
        Log.W("Warn--");
        Log.E("Error--");

        p.Elapsed("Test#Logs");
        p.Stop();

        return(this);
    }
Example #2
0
    public Test AnotherLog()
    {
        var p = new PerfLog();

        p.Start();

        DF("Debug---");
        IF("Info---");
        WF("Warn---");
        EF("Error---");

        p.Wrap("Test#AnotherLog", "test/another.log");
        p.Stop();

        return(this);
    }
Example #3
0
        static void Main(string[] args)
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += (o, e) =>
                {
                    Log.O(((Exception)e.ExceptionObject).ToString());
                };

                Log.LogFile = "test/result.log";

                var testcount = 1001;
                var test      = new Test();

                if (null != args && args.Length > 0)
                {
                    int.TryParse(args[0], out testcount);
                }
                Log.O($"Test count: {testcount}");

                var p = new PerfLog();
                p.Start();

                for (var i = 0; i < testcount; i++)
                {
                    Log.LogLevel = Log.Level.DEBUG;
                    Log.D("Hello bugs");
                    Log.I("For your information");
                    Log.W("Caution, the sky is falling.");
                    Log.E("Oh what's wrong, the sky fell.");

                    Test.StaticLogs();
                    test.Logs().AnotherLog();
                }

                p.Wrap("Test#Program");
                p.Stop();

                Log.O("Test ended.");
            }
            catch (Exception e)
            {
                Log.E(e.ToString());
            }
        }