include/SDL_log.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 30 Oct 2011 17:31:59 -0400
changeset 6038 3e0f5912363d
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
permissions -rw-r--r--
Fixed typo - thanks Sheena!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
     2
  Simple DirectMedia Layer
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
     3
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
     7
  arising from the use of this software.
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    11
  freely, subject to the following restrictions:
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5348
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
 *  \file SDL_log.h
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
 *  
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
 *  Simple log messages with categories and priorities.
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
 *
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
 *  By default logs are quiet, but if you're debugging SDL you might want:
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
 *
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
 *      SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
 *
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
 *  Here's where the messages go on different platforms:
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
 *      Windows: debug output stream
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
 *      Android: log output
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
 *      Others: standard error output (stderr)
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
#ifndef _SDL_log_h
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
#define _SDL_log_h
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
#include "SDL_stdinc.h"
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
#include "begin_code.h"
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
/* Set up for C function definitions, even when using C++ */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
#ifdef __cplusplus
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
/* *INDENT-OFF* */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
extern "C" {
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    47
/* *INDENT-ON* */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
#endif
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    49
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    50
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    52
 *  \brief The maximum size of a log message
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    53
 *
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
 *  Messages longer than the maximum size will be truncated
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
#define SDL_MAX_LOG_MESSAGE 4096
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
 *  \brief The predefined log categories
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
 *
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
 *  By default the application category is enabled at the INFO level,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
 *  and all other categories are enabled at the CRITICAL level.
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    63
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
enum
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    65
{
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    66
    SDL_LOG_CATEGORY_APPLICATION,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
    SDL_LOG_CATEGORY_ERROR,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
    SDL_LOG_CATEGORY_SYSTEM,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
    SDL_LOG_CATEGORY_AUDIO,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
    SDL_LOG_CATEGORY_VIDEO,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
    SDL_LOG_CATEGORY_RENDER,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
    SDL_LOG_CATEGORY_INPUT,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
    /* Reserved for future SDL library use */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
    SDL_LOG_CATEGORY_RESERVED1,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    76
    SDL_LOG_CATEGORY_RESERVED2,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
    SDL_LOG_CATEGORY_RESERVED3,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
    SDL_LOG_CATEGORY_RESERVED4,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    79
    SDL_LOG_CATEGORY_RESERVED5,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    80
    SDL_LOG_CATEGORY_RESERVED6,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
    SDL_LOG_CATEGORY_RESERVED7,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    82
    SDL_LOG_CATEGORY_RESERVED8,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
    SDL_LOG_CATEGORY_RESERVED9,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    84
    SDL_LOG_CATEGORY_RESERVED10,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    85
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    86
    /* Beyond this point is reserved for application use, e.g.
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
       enum {
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
           MYAPP_CATEGORY_AWESOME2,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    90
           MYAPP_CATEGORY_AWESOME3,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    91
           ...
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    92
       };
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    93
     */
5303
d4074e52e739 Fixed gcc -pedantic warning
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    94
    SDL_LOG_CATEGORY_CUSTOM
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
};
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    96
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
 *  \brief The predefined log priorities
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    99
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   100
typedef enum
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   101
{
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   102
    SDL_LOG_PRIORITY_VERBOSE = 1,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   103
    SDL_LOG_PRIORITY_DEBUG,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   104
    SDL_LOG_PRIORITY_INFO,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   105
    SDL_LOG_PRIORITY_WARN,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   106
    SDL_LOG_PRIORITY_ERROR,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   107
    SDL_LOG_PRIORITY_CRITICAL,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   108
    SDL_NUM_LOG_PRIORITIES
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   109
} SDL_LogPriority;
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   110
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   111
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   112
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   113
 *  \brief Set the priority of all log categories
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   114
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   115
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   116
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   117
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   118
 *  \brief Set the priority of a particular log category
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   119
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   120
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   121
                                                SDL_LogPriority priority);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   122
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   123
/**
6038
3e0f5912363d Fixed typo - thanks Sheena!
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   124
 *  \brief Get the priority of a particular log category
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   125
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   126
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   127
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   128
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   129
 *  \brief Reset all priorities to default.
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   130
 *
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   131
 *  \note This is called in SDL_Quit().
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   132
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   133
extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   134
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   135
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   136
 *  \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   137
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   138
extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   139
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   140
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   141
 *  \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   142
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   143
extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   144
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   145
/**
5348
16202b090a63 Added missing log debug function
Sam Lantinga <slouken@libsdl.org>
parents: 5303
diff changeset
   146
 *  \brief Log a message with SDL_LOG_PRIORITY_DEBUG
16202b090a63 Added missing log debug function
Sam Lantinga <slouken@libsdl.org>
parents: 5303
diff changeset
   147
 */
16202b090a63 Added missing log debug function
Sam Lantinga <slouken@libsdl.org>
parents: 5303
diff changeset
   148
extern DECLSPEC void SDLCALL SDL_LogDebug(int category, const char *fmt, ...);
16202b090a63 Added missing log debug function
Sam Lantinga <slouken@libsdl.org>
parents: 5303
diff changeset
   149
16202b090a63 Added missing log debug function
Sam Lantinga <slouken@libsdl.org>
parents: 5303
diff changeset
   150
/**
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   151
 *  \brief Log a message with SDL_LOG_PRIORITY_INFO
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   152
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   153
extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   154
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   155
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   156
 *  \brief Log a message with SDL_LOG_PRIORITY_WARN
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   157
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   158
extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   159
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   160
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   161
 *  \brief Log a message with SDL_LOG_PRIORITY_ERROR
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   162
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   163
extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   164
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   165
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   166
 *  \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   167
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   168
extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   169
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   170
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   171
 *  \brief Log a message with the specified category and priority.
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   172
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   173
extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   174
                                            SDL_LogPriority priority,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   175
                                            const char *fmt, ...);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   176
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   177
/**
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   178
 *  \brief Log a message with the specified category and priority.
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   179
 */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   180
extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   181
                                             SDL_LogPriority priority,
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   182
                                             const char *fmt, va_list ap);
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   183
5235
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   184
/**
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   185
 *  \brief The prototype for the log output function
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   186
 */
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   187
typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   188
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   189
/**
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   190
 *  \brief Get the current log output function.
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   191
 */
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   192
extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   193
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   194
/**
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   195
 *  \brief This function allows you to replace the default log output
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   196
 *         function with one of your own.
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   197
 */
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   198
extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
1e28342cb15d Added a way to replace the default logging mechanism
Sam Lantinga <slouken@libsdl.org>
parents: 5221
diff changeset
   199
5221
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   200
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   201
/* Ends C function definitions when using C++ */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   202
#ifdef __cplusplus
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   203
/* *INDENT-OFF* */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   204
}
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   205
/* *INDENT-ON* */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   206
#endif
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   207
#include "close_code.h"
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   208
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   209
#endif /* _SDL_log_h */
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   210
2ee8112bfc6b Added a simple log message API
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   211
/* vi: set ts=4 sw=4 expandtab: */