1.1 --- a/plugins/include/sourcemod.inc Sun Aug 26 20:12:30 2007 +0000
1.2 +++ b/plugins/include/sourcemod.inc Mon Aug 27 02:00:37 2007 +0000
1.3 @@ -167,6 +167,26 @@
1.4 forward OnAllPluginsLoaded();
1.5
1.6 /**
1.7 + * Called when an action is going to be logged.
1.8 + *
1.9 + * @param source Handle to the object logging the action, or INVALID_HANDLE
1.10 + * if Core is logging the action.
1.11 + * @param ident Type of object logging the action (plugin, ext, or core).
1.12 + * @param client Client the action is from; 0 for server, -1 if not applicable.
1.13 + * @param target Client the action is targetting, or -1 if not applicable.
1.14 + * @param message Message that is being logged.
1.15 + * @return Plugin_Continue will cause Core to defaulty log the message.
1.16 + * Plugin_Handled will stop Core from logging the message.
1.17 + * Plugin_Stop is the same as Handled, but prevents any other
1.18 + * plugins from handling the message.
1.19 + */
1.20 +forward Action:OnLogAction(Handle:source,
1.21 + Identity:ident,
1.22 + client,
1.23 + target,
1.24 + const String:message[]);
1.25 +
1.26 +/**
1.27 * Returns the calling plugin's Handle.
1.28 *
1.29 * @return Handle of the calling plugin.
1.30 @@ -264,7 +284,8 @@
1.31 native ThrowError(const String:fmt[], any:...);
1.32
1.33 /**
1.34 - * Logs a plugin message to the SourceMod logs.
1.35 + * Logs a plugin message to the SourceMod logs. The log message will be
1.36 + * prefixed by the plugin's logtag (filename).
1.37 *
1.38 * @param format String format.
1.39 * @param ... Format arguments.
1.40 @@ -273,6 +294,53 @@
1.41 native LogMessage(const String:format[], any:...);
1.42
1.43 /**
1.44 + * Logs a message to the SourceMod logs without any plugin logtag. This is
1.45 + * useful for re-routing messages from other plugins, for example, messages
1.46 + * from LogAction().
1.47 + *
1.48 + * @param format String format.
1.49 + * @param ... Format arguments.
1.50 + * @noreturn
1.51 + */
1.52 +native LogMessageEx(const String:format[], any:...);
1.53 +
1.54 +/**
1.55 + * Logs a message to any file. The log message will be in the normal
1.56 + * SourceMod format, with the plugin logtag prepended.
1.57 + *
1.58 + * @param file File to write the log message in.
1.59 + * @param format String format.
1.60 + * @param ... Format arguments.
1.61 + * @noreturn
1.62 + * @error File could not be opened/written.
1.63 + */
1.64 +native LogToFile(const String:file[], const String:format[], any:...);
1.65 +
1.66 +/**
1.67 + * Same as LogToFile(), except no plugin logtag is prepended.
1.68 + *
1.69 + * @param file File to write the log message in.
1.70 + * @param format String format.
1.71 + * @param ... Format arguments.
1.72 + * @noreturn
1.73 + * @error File could not be opened/written.
1.74 + */
1.75 +native LogToFileEx(const String:file[], const String:format[], any:...);
1.76 +
1.77 +/**
1.78 + * Logs an action from a command or event whereby interception and routing may
1.79 + * be important. This is intended to be a logging version of ShowActivity().
1.80 + *
1.81 + * @param client Client performing the action, 0 for server, or -1 if not
1.82 + * applicable.
1.83 + * @param target Client being targetted, or -1 if not applicable.
1.84 + * @param message Message format.
1.85 + * @param ... Message formatting parameters.
1.86 + * @noreturn
1.87 + */
1.88 +native LogAction(client, target, const String:message[], any:...);
1.89 +
1.90 +/**
1.91 * Logs a plugin error message to the SourceMod logs.
1.92 *
1.93 * @param format String format.