Browse Source

First version of PonyLogManager

Bawaaaaah 4 years ago
commit
edf467992e

+ 40 - 0
.gitignore

@@ -0,0 +1,40 @@
+#Autosave files
+*~
+
+#build
+[Oo]bj/
+[Bb]in/
+packages/
+TestResults/
+
+# globs
+Makefile.in
+*.DS_Store
+*.sln.cache
+*.suo
+*.cache
+*.pidb
+*.userprefs
+*.usertasks
+config.log
+config.make
+config.status
+aclocal.m4
+install-sh
+autom4te.cache/
+*.user
+*.tar.gz
+tarballs/
+test-results/
+Thumbs.db
+
+#Mac bundle stuff
+*.dmg
+*.app
+
+#resharper
+*_Resharper.*
+*.Resharper
+
+#dotCover
+*.dotCover

+ 21 - 0
LICENCE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Samuel LEMAITRE
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 23 - 0
PonyLogManager.sln

@@ -0,0 +1,23 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PonyLogManager", "PonyLogManager\PonyLogManager.csproj", "{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PonyLogManagerDemo", "PonyLogManagerDemo\PonyLogManagerDemo.csproj", "{DD9C3EDB-22CE-4633-A6DC-F0FE68C0BE31}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x86 = Debug|x86
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}.Debug|x86.Build.0 = Debug|Any CPU
+		{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}.Release|x86.ActiveCfg = Release|Any CPU
+		{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}.Release|x86.Build.0 = Release|Any CPU
+		{DD9C3EDB-22CE-4633-A6DC-F0FE68C0BE31}.Debug|x86.ActiveCfg = Debug|x86
+		{DD9C3EDB-22CE-4633-A6DC-F0FE68C0BE31}.Debug|x86.Build.0 = Debug|x86
+		{DD9C3EDB-22CE-4633-A6DC-F0FE68C0BE31}.Release|x86.ActiveCfg = Release|x86
+		{DD9C3EDB-22CE-4633-A6DC-F0FE68C0BE31}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+EndGlobal

+ 54 - 0
PonyLogManager/Extending.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Runtime.CompilerServices;
+
+namespace PonyLogManager
+{
+	public static class Extending
+	{
+		/********************
+		 *  default LOG to  *
+		 * default instance *
+		 ********************/
+		public static void TRACE(this Exception e, LogManager lm = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			lm = lm ?? LogManager.defaultInstance;
+			lm.trace(e, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public static void DEBUG(this Exception e, LogManager lm = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			lm = lm ?? LogManager.defaultInstance;
+			LogManager.defaultInstance.debug(e, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public static void INFO(this Exception e, LogManager lm = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			lm = lm ?? LogManager.defaultInstance;
+			LogManager.defaultInstance.info(e, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public static void WARN(this Exception e, LogManager lm = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			lm = lm ?? LogManager.defaultInstance;
+			LogManager.defaultInstance.warn(e, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public static void ERROR(this Exception e, LogManager lm = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			lm = lm ?? LogManager.defaultInstance;
+			LogManager.defaultInstance.error(e, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public static void FATAL(this Exception e, LogManager lm = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			lm = lm ?? LogManager.defaultInstance;
+			LogManager.defaultInstance.fatal(e, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public static bool errorLevelIsMinRequire(this LogManager.ErrorType min, LogManager.ErrorType err)
+		{
+			return LogManager.errorLevelIsMinRequire(min, err);
+		}
+	}
+}
+

+ 210 - 0
PonyLogManager/LogManager.cs

@@ -0,0 +1,210 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace PonyLogManager
+{
+	public class LogManager
+	{
+
+		public static LogManager defaultInstance = new LogManager();
+
+		[Flags]
+		public enum ErrorType
+		{
+			OFF = 0,
+			TRACE = 1,
+			DEBUG = 2,
+			INFO = 4,
+			WARN = 8,
+			ERROR = 16,
+			FATAL = 32,
+			ALL = 63
+		}
+		public bool writeDateTime;
+		public String logPath;
+		public ErrorType writeToConsole;
+		public ErrorType writeToFile;
+
+		public delegate void StringExceptCatched(ErrorType eType, String message, string memberName, string sourceFilePath, int sourceLineNumber, DateTime? dt);
+		public StringExceptCatched stringExceptCatched = null;
+		public delegate void ExceptCatched(ErrorType eType, Exception except, string memberName, string sourceFilePath, int sourceLineNumber, DateTime? dt);
+		public ExceptCatched exceptCatched = null;
+		public delegate void ObjectExceptCatched(ErrorType eType, Object except, string memberName, string sourceFilePath, int sourceLineNumber, DateTime? dt);
+		public ObjectExceptCatched objectExceptCatched = null;
+
+		private static Object loggingConsoleLocker = new Object();
+		private Object loggingFileLocker = new Object();
+
+		public LogManager(ErrorType writeToConsole = ErrorType.ERROR, ErrorType writeToFile = ErrorType.ERROR, String logPath = null, bool writeDateTime = false)
+		{
+			this.logPath = logPath ?? AppDomain.CurrentDomain.BaseDirectory + "logFile.log";
+			this.writeToConsole = writeToConsole;
+			this.writeToFile = writeToFile;
+			this.writeDateTime = writeDateTime;
+		}
+
+		public void trace(Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			log(ErrorType.TRACE, exceptObject, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public void debug(Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			log(ErrorType.DEBUG, exceptObject, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public void info(Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			log(ErrorType.INFO, exceptObject, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public void warn(Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			log(ErrorType.WARN, exceptObject, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public void error(Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			log(ErrorType.ERROR, exceptObject, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public void fatal(Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			log(ErrorType.FATAL, exceptObject, memberName, sourceFilePath, sourceLineNumber, dt);
+		}
+
+		public void log(ErrorType eType, Object exceptObject, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			DateTime dateTime = dt ?? DateTime.Now;
+			if (exceptObject.GetType() == typeof(String)) {
+				log(eType, (String)exceptObject, memberName, sourceFilePath, sourceLineNumber, dateTime);
+			} else if (typeof(Exception).IsAssignableFrom(exceptObject.GetType())) {
+				log(eType, (Exception)exceptObject, memberName, sourceFilePath, sourceLineNumber, dateTime);
+			} else {
+				if (objectExceptCatched != null)
+				{
+					foreach (ObjectExceptCatched objCatched in objectExceptCatched.GetInvocationList())
+					{
+						var t = new Thread(new ThreadStart(delegate() { objCatched(eType, exceptObject, memberName, sourceFilePath, sourceLineNumber, dateTime); }));
+						t.SetApartmentState(ApartmentState.STA);
+						t.Start();
+					}
+				}
+			}
+		}
+
+		public void log(ErrorType eType, Exception except, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			DateTime dateTime = dt ?? DateTime.Now;
+			logging(eType, (writeDateTime ? "Except datetime : " + dateTime.ToLongDateString() + " at " + dateTime.ToLongTimeString() + Environment.NewLine : "") + parseException(except));
+			if (exceptCatched != null)
+			{
+				foreach (ExceptCatched exptCatched in exceptCatched.GetInvocationList())
+				{
+					var t = new Thread(new ThreadStart(delegate() { exptCatched(eType, except, memberName, sourceFilePath, sourceLineNumber, dt); }));
+					t.SetApartmentState(ApartmentState.STA);
+					t.Start();
+				}
+			}
+		}
+
+		public void log(ErrorType eType, String message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0, DateTime? dt = null)
+		{
+			DateTime dateTime = dt ?? DateTime.Now;
+			logging(eType, (writeDateTime ? "Except datetime : " + dateTime.ToLongDateString() + " at " + dateTime.ToLongTimeString() + Environment.NewLine : "") + generateStringException(message, memberName, sourceFilePath, sourceLineNumber));
+			if (stringExceptCatched != null)
+			{
+				foreach (StringExceptCatched strCatched in stringExceptCatched.GetInvocationList())
+				{
+					var t = new Thread(new ThreadStart(delegate() { strCatched(eType, message, memberName, sourceFilePath, sourceLineNumber, dt); }));
+					t.SetApartmentState(ApartmentState.STA);
+					t.Start();
+				}
+			}
+		}
+
+		private void logging(ErrorType eType, String message)
+		{
+			lock (loggingConsoleLocker)
+				if (errorLevelIsMinRequire(writeToConsole, eType))
+					Console.Error.WriteLine(message);
+
+			lock (loggingFileLocker)
+				if (errorLevelIsMinRequire(writeToFile, eType) && logPath != "")
+				{
+					try
+					{
+						var tmp = logPath;
+						DirectoryInfo dir = new FileInfo(tmp).Directory;
+						if (!dir.Exists)
+							dir.CreateSubdirectory(new FileInfo(tmp).Directory.FullName);
+
+						System.IO.File.AppendAllText(tmp, message);
+					}
+					catch (Exception e)
+					{
+						Console.Error.WriteLine(parseException(e));
+					}
+				}
+		}
+
+		public static bool errorLevelIsMinRequire(ErrorType min, ErrorType err)
+		{
+			if (min != ErrorType.OFF && ( min <= err || min == ErrorType.ALL))
+				return true;
+			return false;
+		}
+
+		private String parseException(Exception e)
+		{
+			var seperator = "";
+			for (int i = 0; i < e.Source.Length; i++)
+				seperator += "#";
+
+			String rturn = "####" + seperator + Environment.NewLine
+				+ "# " + e.Source + " #" + Environment.NewLine
+				+ "####" + seperator + Environment.NewLine
+				+ e.Message + Environment.NewLine;
+
+			for (int i = 0; i < e.Message.Split('\n').Reverse().ToList()[0].Length; i++)
+				rturn += "_";
+
+			rturn += Environment.NewLine + e.StackTrace + Environment.NewLine;
+
+			for (int i = 0; i < e.StackTrace.Split('\n').Reverse().ToList()[0].Length; i++)
+				rturn += "-";
+
+			return rturn+ Environment.NewLine;
+		}
+
+		private String generateStringException(String message, string memberName, string sourceFilePath, int sourceLineNumber)
+		{
+			var seperator = "";
+
+			for (int i = 0; i < memberName.Length; i++)
+				seperator += "#";
+
+			String rturn = "####" + seperator + Environment.NewLine
+				+ "# " + memberName + " #" + Environment.NewLine
+				+ "####" + seperator + Environment.NewLine
+				+ message + Environment.NewLine;
+
+			for (int i = 0; i < message.Split('\n').Reverse().ToList()[0].Length; i++)
+				rturn += "_";
+			
+			var lastTrace = "File: " + sourceFilePath + " line: " + sourceLineNumber;
+			rturn += Environment.NewLine + lastTrace + Environment.NewLine;
+
+			for (int i = 0; i < lastTrace.Split('\n').Reverse().ToList()[0].Length; i++)
+				rturn += "-";
+
+			return rturn + Environment.NewLine;
+		}
+	}
+}

+ 39 - 0
PonyLogManager/PonyLogManager.csproj

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>PonyLogManager</RootNamespace>
+    <AssemblyName>PonyLogManager</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="LogManager.cs" />
+    <Compile Include="Extending.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>

+ 27 - 0
PonyLogManager/Properties/AssemblyInfo.cs

@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("PonyLogManager")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("bawaaaaah")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 46 - 0
PonyLogManagerDemo/PonyLogManagerDemo.csproj

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProjectGuid>{DD9C3EDB-22CE-4633-A6DC-F0FE68C0BE31}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>PonyLogManagerDemo</RootNamespace>
+    <AssemblyName>PonyLogManagerDemo</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <ProjectReference Include="..\PonyLogManager\PonyLogManager.csproj">
+      <Project>{20E80B9D-6F4C-4041-ACF7-3D7653A9C375}</Project>
+      <Name>PonyLogManager</Name>
+    </ProjectReference>
+  </ItemGroup>
+</Project>

+ 50 - 0
PonyLogManagerDemo/Program.cs

@@ -0,0 +1,50 @@
+using System;
+using PonyLogManager;
+
+namespace PonyLogManagerDemo
+{
+	class MainClass
+	{
+		public static void Main (string[] args)
+		{
+			LogManager customLogManager = new LogManager(LogManager.ErrorType.OFF, LogManager.ErrorType.FATAL, "customlogfile.log", true);
+			// all delegate where execute in thread
+			LogManager.defaultInstance.objectExceptCatched += objLog;
+			LogManager.defaultInstance.writeToConsole = LogManager.ErrorType.TRACE;
+
+			DemoClass demoClass = new DemoClass(){ jobs = "Demo for PonyLogManager" };
+			demoClass.sw.Start();
+
+			LogManager.defaultInstance.trace("Start demo");
+			try{
+				int a = 0, b = 0;
+				a /= b;
+			} catch (Exception e) {
+				e.ERROR();
+				// you can also
+				LogManager.defaultInstance.debug(e);
+				// or
+				e.DEBUG(customLogManager);
+				customLogManager.debug(e);
+			}
+			demoClass.sw.Stop();
+			LogManager.defaultInstance.debug(demoClass);
+			LogManager.defaultInstance.trace("End demo");
+			Console.Read();
+		}
+
+		private static void objLog(LogManager.ErrorType eType, Object except, string memberName, string sourceFilePath, int sourceLineNumber, DateTime? dt){
+			if(!LogManager.ErrorType.DEBUG.errorLevelIsMinRequire(eType))
+				return;
+			if (except.GetType().IsAssignableFrom(typeof(DemoClass))) {
+				DemoClass demo = (DemoClass)except;
+				Console.WriteLine(demo.jobs + " in " + demo.sw.ElapsedMilliseconds + "ms");
+			}
+		}
+
+		private class DemoClass{
+			public String jobs = "";
+			public System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
+		}
+	}
+}

+ 27 - 0
PonyLogManagerDemo/Properties/AssemblyInfo.cs

@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("PonyLogManagerDemo")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("bawaaaaah")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 3 - 0
readme.md

@@ -0,0 +1,3 @@
+It's an hackable and thread safe c# logmanager for your project.
+
+use it, enjoy it, hack it, improve it =)