Upgrade the logger component
[master-thesis.git] / Parasitemia / Logger / Readme.md
diff --git a/Parasitemia/Logger/Readme.md b/Parasitemia/Logger/Readme.md
new file mode 100644 (file)
index 0000000..59f7ac2
--- /dev/null
@@ -0,0 +1,42 @@
+# Logger
+
+Logger is a small component to log various messages to disk.
+
+
+## Features
+
+* Split log file after a certain size (50 MB) and zip old files.
+* Multi level logging: debug, info, warning, error, fatal
+* Log these informations:
+  * Date + time
+  * Level
+  * Caller assembly
+  * Thread name and its number
+  * Message
+
+## Usage
+
+Samples to log to a directory located in the user space:
+
+### F#
+
+~~~F#
+let userApplicationDirectory = System.IO.Path.Combine (System.Environment.GetFolderPath System.Environment.SpecialFolder.ApplicationData, "My Application")
+Log.LogDirectory <- System.IO.Path.Combine (userApplicationDirectory, "Log")
+
+let v = 42
+Log.Info "V equals %i" 42
+~~~
+
+### C#
+
+~~~C#
+var userApplicationDirectory = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData), "My Application");
+Log.LogDirectory = System.IO.Path.Combine(userApplicationDirectory, "Log");
+
+var v = 42;
+Log.INFO("V equals {0}", 42);
+~~~
+
+
+