Fixed error when reloading dependant plugins using aliased natives (
bug 5302, r=psychonic).
3 * =============================================================================
4 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 * =============================================================================
7 * This file is part of the SourceMod/SourcePawn SDK.
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, version 3.0, as published by the
11 * Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 * As a special exception, AlliedModders LLC gives you permission to link the
22 * code of this program (as well as its derivative works) to "Half-Life 2," the
23 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 * by the Valve Corporation. You must obey the GNU General Public License in
25 * all respects for all other code used. Additionally, AlliedModders LLC grants
26 * this exception to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 * or <http://www.sourcemod.net/license.php>.
33 #if defined _sm_logging_included
36 #define _sm_logging_included
39 * Logs a plugin message to the SourceMod logs. The log message will be
40 * prefixed by the plugin's logtag (filename).
42 * @param format String format.
43 * @param ... Format arguments.
46 native LogMessage(const String:format[], any:...);
49 * Logs a message to the SourceMod logs without any plugin logtag. This is
50 * useful for re-routing messages from other plugins, for example, messages
53 * @param format String format.
54 * @param ... Format arguments.
57 native LogMessageEx(const String:format[], any:...);
60 * Logs a message to any file. The log message will be in the normal
61 * SourceMod format, with the plugin logtag prepended.
63 * @param file File to write the log message in.
64 * @param format String format.
65 * @param ... Format arguments.
67 * @error File could not be opened/written.
69 native LogToFile(const String:file[], const String:format[], any:...);
72 * Same as LogToFile(), except no plugin logtag is prepended.
74 * @param file File to write the log message in.
75 * @param format String format.
76 * @param ... Format arguments.
78 * @error File could not be opened/written.
80 native LogToFileEx(const String:file[], const String:format[], any:...);
83 * Logs an action from a command or event whereby interception and routing may
84 * be important. This is intended to be a logging version of ShowActivity().
86 * @param client Client performing the action, 0 for server, or -1 if not
88 * @param target Client being targetted, or -1 if not applicable.
89 * @param message Message format.
90 * @param ... Message formatting parameters.
93 native LogAction(client, target, const String:message[], any:...);
96 * Logs a plugin error message to the SourceMod logs.
98 * @param format String format.
99 * @param ... Format arguments.
102 native LogError(const String:format[], any:...);
105 * Called when an action is going to be logged.
107 * @param source Handle to the object logging the action, or INVALID_HANDLE
108 * if Core is logging the action.
109 * @param ident Type of object logging the action (plugin, ext, or core).
110 * @param client Client the action is from; 0 for server, -1 if not applicable.
111 * @param target Client the action is targetting, or -1 if not applicable.
112 * @param message Message that is being logged.
113 * @return Plugin_Continue will cause Core to defaulty log the message.
114 * Plugin_Handled will stop Core from logging the message.
115 * Plugin_Stop is the same as Handled, but prevents any other
116 * plugins from handling the message.
118 forward Action:OnLogAction(Handle:source,
122 const String:message[]);
125 * Called when a game log message is received.
127 * Any Log*() functions called within this callback will not recursively
128 * pass through. That is, they will log directly, bypassing this callback.
130 * Note that this does not capture log messages from the engine. It only
131 * captures log messages being sent from the game/mod itself.
133 * @param message Message contents.
134 * @return Plugin_Handled or Plugin_Stop will prevent the message
135 * from being written to the log file.
137 functag public Action:GameLogHook(const String:message[]);
140 * Adds a game log hook.
142 * @param hook Hook function.
145 native AddGameLogHook(GameLogHook:hook);
148 * Removes a game log hook.
150 * @param hook Hook function.
153 native RemoveGameLogHook(GameLogHook:hook);