Menu

LogThis 1.0 is released

LogThis 1.0 is released with the following features.
Future plans for LogThis include adding additional LogWhere locations of a user specified email address and possibly a plugin feature that would run user provided method which would allow custom extensions to be added on.
As time permits I will try to produce more documentation, although it was entended to be simple enough to just drop into an application and start using it straight away.

LogThis is a C# class file intended to be simply dropped into any c# project.
It is written so that it can be invoked from anywhere in the project without
creating an instance of the object. In other words, Log.LogThis doesn't require
you to create an instance of Log before using it.
While an instance of Log is created (probably in Main()) it is only needed long
enough to run Log.Init and then the instance can be destroyed. This is the
closest to having global methods as can be had in c#. Enjoy.

The main functionality of the object is Log.LogThis(string logtext,eloglevel loglevel)
where you pass the log message and a log level. You also set the Log.LogLevel value.
The log levels are (error,warn,info and verbose).
For instance, if you set Log.LogLevel = eloglevel.warn then
Log.LogThis("test",eloglevel.info) would not get logged. A Log.LogLevel = warn means
logs which have a value of warn or error will get logged. A Log.Loglevel = Info
means logs which have a value of Info, Warn or error will get logged. This allows
you to pepper your application with log messages aimed at a specific level of
criticality and the the Log.LogLevel determines which will be actually logged.
This is a great benefit when you want to turn debugging (verbose) on or off during runtime.

[Methods]:
Log.Init()
Log.Init(elogprofile logprofile)
Log.LogHeader(elogprofile logprofile, string Text,elogheaderlevel logheaderlevel)
Log.GetProfile(elogprofile logprofile)
Log.LogReset()
Log.LogReset(elogprofile logprofile)
Log.LogThis(string logtext,eloglevel loglevel)
Log.LogThis(elogprofile logprofile, string logtext,eloglevel loglevel)

[Properties]:
Log.LogLevel
Log.LogName
Log.LogNameFormat
Log.LogPath
Log.LogPeriod
Log.LogQuotaFormat
Log.LogSizeMax
Log.LogWhere
Log.ProcessName
Log.Profile

Posted by Dave 2004-03-01

Log in to post a comment.