doc/html/trace.html
changeset 0 d15304fcb7a7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/html/trace.html	Tue Apr 06 07:36:14 2004 +0000
     1.3 @@ -0,0 +1,88 @@
     1.4 +<!-- vi: set ts=4 sw=4 : -->
     1.5 +<!-- vim: set tw=75 : -->
     1.6 +
     1.7 +<HTML>
     1.8 +<head>
     1.9 +<title>Metamod TraceAPI Plugin</title>
    1.10 +</head>
    1.11 +<body>
    1.12 +
    1.13 +<h1>TraceAPI plugin
    1.14 +</h1>
    1.15 +
    1.16 +<p> This was originally intended as a (more or less) complete example of a
    1.17 +Metamod plugin.  It catches <b><i>every</i></b> call available to it (dll
    1.18 +routines both before and after the game, as well as engine functions both
    1.19 +before and after the engine).
    1.20 +
    1.21 +<p> Because it catches every routine, I figured I'd give it the ability to
    1.22 +log when given routines are called, so it became an "api tracing" plugin.
    1.23 +:)
    1.24 +
    1.25 +<p> This can actually be useful for tracking the operation of the HL
    1.26 +engine, as well as that of a particular HL game mod.
    1.27 +
    1.28 +<p> It recognizes the following server cvars:
    1.29 +
    1.30 +<p><pre>
    1.31 +   // Tracing debug levels; higher values log increasingly frequent routines.
    1.32 +   // Currently 0-50.  See "api_info.cpp" for the debug levels of various
    1.33 +   // functions.
    1.34 +
    1.35 +   // Trace level for dllapi routines.
    1.36 +   trace_dllapi
    1.37 +
    1.38 +   // Trace level for "new" dllapi routines.
    1.39 +   trace_newapi
    1.40 +
    1.41 +   // Trace level for engine functions.
    1.42 +   trace_engine
    1.43 +
    1.44 +   // Enable unlimited trace logging.  By default (as of v1.06), it only
    1.45 +   // logs _one_ trace message per second, to keep from overwhelming the
    1.46 +   // server.  Set to "1" to enable unlimited logging.  (Default "0")
    1.47 +   trace_unlimit
    1.48 +
    1.49 +   // General debug level, independent of trace levels.  Not currently used.
    1.50 +   trace_debug
    1.51 +
    1.52 +</pre>
    1.53 +
    1.54 +<p> and the following server commands:
    1.55 +
    1.56 +<p><pre>
    1.57 +   // Enable tracing of a given routine, independent of "trace_*" level.
    1.58 +   // See the list of routine names in "api_info.cpp".  Case is insignificant.
    1.59 +   trace set &lt;APIroutine&gt;
    1.60 +
    1.61 +   // Disable tracing of a given routine, iff previously enabled with "trace".
    1.62 +   // Doesn't affect routines being logged via "trace_*" level.
    1.63 +   trace unset &lt;APIroutine&gt;
    1.64 +
    1.65 +   // Show the routines being traced.
    1.66 +   trace show
    1.67 +
    1.68 +   // List the various routines that can be traced.
    1.69 +   trace list dllapi
    1.70 +   trace list newapi
    1.71 +   trace list engine
    1.72 +   trace list all
    1.73 +
    1.74 +   // Prints out version/date/etc.
    1.75 +   trace version
    1.76 +</pre>
    1.77 +
    1.78 +<p> Note the information it logs on each routine invocation is, at the
    1.79 +moment, relatively minimal.  I included information that seemed obvious
    1.80 +(args for a <tt>ClientCommand</tt>, etc), and I've added info for other
    1.81 +routines as I've come across a need.  Most routines I still know too little
    1.82 +about to log any particular information (<tt>CreateBaseline</tt>, etc).
    1.83 +Feel free to add information that you're interested in to the log messages
    1.84 +in the routines; the examples should be pretty self-explanatory.  I'd be
    1.85 +interested in knowing as well, for adding it to the distribution code.
    1.86 +
    1.87 +<p>
    1.88 +<hr>
    1.89 +
    1.90 +</body>
    1.91 +</HTML>