log.c (1799B)
1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20#include "config.h" 21 22#include "client.h" 23#include "common/iconv.h" 24#include "common/surface.h" 25 26#include <cairo/cairo.h> 27#include <guacamole/client.h> 28#include <guacamole/layer.h> 29#include <guacamole/protocol.h> 30#include <guacamole/socket.h> 31#include <rfb/rfbclient.h> 32#include <rfb/rfbproto.h> 33 34#include <stdarg.h> 35#include <stdio.h> 36#include <stdlib.h> 37#include <syslog.h> 38 39void guac_vnc_client_log_info(const char* format, ...) { 40 41 char message[2048]; 42 43 /* Copy log message into buffer */ 44 va_list args; 45 va_start(args, format); 46 vsnprintf(message, sizeof(message), format, args); 47 va_end(args); 48 49 /* Log to syslog */ 50 syslog(LOG_INFO, "%s", message); 51 52} 53 54void guac_vnc_client_log_error(const char* format, ...) { 55 56 char message[2048]; 57 58 /* Copy log message into buffer */ 59 va_list args; 60 va_start(args, format); 61 vsnprintf(message, sizeof(message), format, args); 62 va_end(args); 63 64 /* Log to syslog */ 65 syslog(LOG_ERR, "%s", message); 66 67} 68