-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient_console_all_sink.inc
42 lines (35 loc) · 1.1 KB
/
client_console_all_sink.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#if defined _log_for_sourcepawn_sinks_client_console_all_sink_included
#endinput
#endif
#define _log_for_sourcepawn_sinks_client_console_all_sink_included
#pragma newdecls required
#pragma semicolon 1
#include <log4sp/sinks/callback_sink>
methodmap ClientConsoleAllSink < CallbackSink
{
/**
* This sink is output to all client console.
*
* @return ClientConsoleSink handle.
*/
public ClientConsoleAllSink()
{
return view_as<ClientConsoleAllSink>(new CallbackSink(_, __CBSink_PrintToClientConsoleAll));
}
/**
* Create a logger handle that outputs to all client console.
*
* @param name The name of the new logger.
* @return Logger handle.
* @error Logger name already exits.
*/
public static Logger CreateLogger(const char[] name) {
Logger logger = new Logger(name);
logger.AddSinkEx(new ClientConsoleAllSink());
return logger;
}
}
static void __CBSink_PrintToClientConsoleAll(const char[] msg)
{
PrintToConsoleAll(msg);
}