log.h (2003B)
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#ifndef GUACLOG_LOG_H 21#define GUACLOG_LOG_H 22 23#include "config.h" 24 25#include <guacamole/client.h> 26 27#include <stdarg.h> 28 29/** 30 * The maximum level at which to log messages. All other messages will be 31 * dropped. 32 */ 33extern int guaclog_log_level; 34 35/** 36 * The string to prepend to all log messages. 37 */ 38#define GUACLOG_LOG_NAME "guaclog" 39 40/** 41 * Writes a message to guaclog's logs. This function takes a format and 42 * va_list, similar to vprintf. 43 * 44 * @param level 45 * The level at which to log this message. 46 * 47 * @param format 48 * A printf-style format string to log. 49 * 50 * @param args 51 * The va_list containing the arguments to be used when filling the format 52 * string for printing. 53 */ 54void vguaclog_log(guac_client_log_level level, const char* format, 55 va_list args); 56 57/** 58 * Writes a message to guaclog's logs. This function accepts parameters 59 * identically to printf. 60 * 61 * @param level 62 * The level at which to log this message. 63 * 64 * @param format 65 * A printf-style format string to log. 66 * 67 * @param ... 68 * Arguments to use when filling the format string for printing. 69 */ 70void guaclog_log(guac_client_log_level level, const char* format, ...); 71 72#endif 73