-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathUtil.cpp
More file actions
33 lines (26 loc) · 766 Bytes
/
Util.cpp
File metadata and controls
33 lines (26 loc) · 766 Bytes
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
/** --------------------------------------------------------------------------
* Util.cpp
*
* A few very basic utility functions for WebSocketServer
*
* Author : Jason Kruse <jason@jasonkruse.com> or @mnisjk
* Copyright : 2014
* License : BSD (see LICENSE)
* --------------------------------------------------------------------------
**/
#include <stdio.h>
#include "Util.h"
using namespace std;
#define LOG_PREFIX "[cppWebSockets] "
void Util::log( const string& message )
{
const string& logMessage = LOG_PREFIX + message;
syslog( LOG_WARNING, "%s", logMessage.c_str( ) );
#ifdef LOG_TO_STDOUT
printf( "%s\n", logMessage.c_str( ) );
#endif
}
void Util::log( const char* message )
{
log( string( message ) );
}