X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FLogger%2FReadme.md;fp=Parasitemia%2FLogger%2FReadme.md;h=59f7ac2255732b9333fefb4cc1279cd7aef898d0;hp=0000000000000000000000000000000000000000;hb=8cf2153bd18919de41745534d3dbf134f085e13c;hpb=6250f10c807301a760b8659f9c00ca6dbbd4c7b7 diff --git a/Parasitemia/Logger/Readme.md b/Parasitemia/Logger/Readme.md new file mode 100644 index 0000000..59f7ac2 --- /dev/null +++ b/Parasitemia/Logger/Readme.md @@ -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); +~~~ + + +