<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3ADebug%2Fclass%2Fdoc</id>
	<title>Modul:Debug/class/doc - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3ADebug%2Fclass%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Modul:Debug/class/doc&amp;action=history"/>
	<updated>2026-04-05T23:45:24Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Verzauberte Welten e.V.</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.verzauberte-welten.de/index.php?title=Modul:Debug/class/doc&amp;diff=4414&amp;oldid=prev</id>
		<title>imported&gt;Oetterer am 23. Dezember 2015 um 21:59 Uhr</title>
		<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Modul:Debug/class/doc&amp;diff=4414&amp;oldid=prev"/>
		<updated>2015-12-23T21:59:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{documentation subpage}}&lt;br /&gt;
{{module rating|beta}}&lt;br /&gt;
&amp;lt;!-- Categories go at the bottom of this page and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a Class Module. It implements a class in Lua using [[Module:Middleclass]]. This class provides methods for creating and printing a debug log.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
{{code|lang=lua|code=&lt;br /&gt;
local classDebug = require('Module:Debug/class')&lt;br /&gt;
local debugObject = classDebug:new('handlername')&lt;br /&gt;
debugObject:methodcall()&lt;br /&gt;
classDebug:staticMethodcall()&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To use the debug log, create an object and provide a (unique) handler. Then log things via [[#log(level, text)|log(level, text)]] or [[#classDebug:log(level, text, handler)|classDebug:log(level, text, handler)]]. At any time, you can print the log. When doing so, you can either&lt;br /&gt;
* print the whole debug log (over all available handlers)&lt;br /&gt;
* or only your specific handler&lt;br /&gt;
&lt;br /&gt;
This class uses a static property to create the debug log, meaning all instances of class debug (all objects) write in one log (ie. a table). Later - depending whether you use the public or the static method - you print only 'your' entries (the one using your handler) or the whole log.&lt;br /&gt;
&lt;br /&gt;
Besides a handler, all entries have a timestamp and a loglevel. On printout, all entries with a loglevel higher than a given number will be ommited.&lt;br /&gt;
&lt;br /&gt;
== Constructor ==&lt;br /&gt;
=== new(handler) ===&lt;br /&gt;
Creates a new Object for class debug.&lt;br /&gt;
;handler&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:identifies your entries. should be unique over all used handlers/objects&lt;br /&gt;
;return&lt;br /&gt;
:object, of class debug&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== Public methods ===&lt;br /&gt;
&lt;br /&gt;
==== __tostring() ====&lt;br /&gt;
Returns a string representation of your debug log (all entries identified by your handler). Uses default debug level and default outputtype.&lt;br /&gt;
{{small|&lt;br /&gt;
;return&lt;br /&gt;
:string, representation of itself&lt;br /&gt;
}}&lt;br /&gt;
 &lt;br /&gt;
==== log(level, text) ====&lt;br /&gt;
Creates a log entry.&lt;br /&gt;
{{small|&lt;br /&gt;
;level&lt;br /&gt;
:integer, mandatory&lt;br /&gt;
:defines the log-level of the entry. the lower, the more important.&lt;br /&gt;
;text&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:the actual log entry&lt;br /&gt;
;return&lt;br /&gt;
:void&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== printLog(level, outputtype) ====&lt;br /&gt;
Prints all log entries having the same handler as this specific object. Not provided parameters will be defaulted. See [[#static|static properties]].&lt;br /&gt;
{{small|&lt;br /&gt;
;level&lt;br /&gt;
:integer, suggested&lt;br /&gt;
:specifies which log entries will be printed in the log. all entries with a level higher than this number will be omitted.&lt;br /&gt;
;outputtype&lt;br /&gt;
:string, suggested&lt;br /&gt;
:formats the log. supported types are 'plain', 'ol', 'ul', 'pre'&lt;br /&gt;
;return&lt;br /&gt;
:string, formatted and filtered debug log&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Static methods ===&lt;br /&gt;
&lt;br /&gt;
==== classDebug:log(level, text, handler) ====&lt;br /&gt;
Creates a log entry. Can be called by other (static) methods without having a debug object at hand.&lt;br /&gt;
{{small|&lt;br /&gt;
;level&lt;br /&gt;
:integer, mandatory&lt;br /&gt;
:defines the log-level of the entry. the lower, the more important.&lt;br /&gt;
;text&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:the actual log entry&lt;br /&gt;
;handler&lt;br /&gt;
:string, suggested&lt;br /&gt;
:helps to identify the log entry. works just like the handler you create when [[#new(handler)|instanciating an object of this class]]&lt;br /&gt;
;return&lt;br /&gt;
:void&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== classDebug:printLog(level, outputtype) ====&lt;br /&gt;
Prints all log entries (effectively doing the same as the public method [[#printLog(level, outputtype)|printLog(level, outputtype)]] only without the handler restriction). Not provided parameters will be defaulted. See [[#static|static properties]]&lt;br /&gt;
{{small|&lt;br /&gt;
;level&lt;br /&gt;
:integer, suggested&lt;br /&gt;
:specifies which log entries will be printed in the log. all entries with a level higher than this number will be omitted.&lt;br /&gt;
;outputtype&lt;br /&gt;
:string, suggested&lt;br /&gt;
:formats the log. supported types are 'plain', 'ol', 'ul', 'pre'&lt;br /&gt;
;return&lt;br /&gt;
:string, formatted and filtered debug log&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Private methods ===&lt;br /&gt;
none&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== static ===&lt;br /&gt;
&lt;br /&gt;
;_debugLog&lt;br /&gt;
:table, holds all debug entries&lt;br /&gt;
;_defaultDebugLevel&lt;br /&gt;
:integer, default log level for printLog methods if none is provided&lt;br /&gt;
;_defaultOutputType&lt;br /&gt;
:string, default output format for printLog methods if none is provided&lt;br /&gt;
;_LANG&lt;br /&gt;
:object, mw.language.new( 'de' ) used for timestamp format in debug log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== private ===&lt;br /&gt;
Note: all private properties are stored in table ''_private[self]''. _private is a static array that is indexed by ''self'', so the table ''_private[self]'' holds all properties for instance ''self''.&lt;br /&gt;
;handler&lt;br /&gt;
:'my' log entry handler with which this object marks all entries it loggs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Class engine]]&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Categories go here if you wish an additional category to that set in {{module rating}} above automatically. --&amp;gt;&lt;br /&gt;
[[Category:Lua metamodules]] [[Category:Lua class modules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Oetterer</name></author>
	</entry>
</feed>