NAME
SDL2::log - Simple Log Messages with Categories and Priorities
SYNOPSIS
use SDL2 qw[:log];
DESCRIPTION
By default, logs are quiet but if you're debugging SDL you might want:
SDL_LogSetAllPriority( SDL_LOG_PRIORITY_WARN );
Here's where the messages go on different platforms:
Functions
These functions may be imported by name or with the :log
tag.
SDL_LogSetAllPriority( ... )
Set the priority of all log categories.
Expected parameters include:
SDL_LogSetPriority( ... )
Set the priority of a particular log category.
Expected parameters include:
SDL_LogGetPriority( ... )
Get the priority of a particular log category.
Expected parameters include:
Returns the SDL_LogPriority
for the requested category.
SDL_LogResetPriorities( )
Reset all priorities to default.
This is called by SDL_Quit( )
.
SDL_Log( ... )
Log a message with SDL_LOG_CATEGORY_APPLICATION
and SDL_LOG_PRIORITY_INFO
.
Expected parameters include:
fmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogVerbose( ... )
Log a message with SDL_LOG_PRIORITY_VERBOSE
.
Expected parameters include:
category
- the category of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogDebug( ... )
Log a message with SDL_LOG_PRIORITY_DEBUG
.
Expected parameters include:
category
- the category of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogInfo( ... )
Log a message with SDL_LOG_PRIORITY_INFO
.
Expected parameters include:
category
- the category of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogWarn( ... )
Log a message with SDL_LOG_PRIORITY_WARN
.
Expected parameters include:
category
- the category of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogError( ... )
Log a message with SDL_LOG_PRIORITY_ERROR
.
Expected parameters include:
category
- the category of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogCritical( ... )
Log a message with SDL_LOG_PRIORITY_CRITICAL
.
Expected parameters include:
category
- the category of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogMessage( ... )
Log a message with the specified category and priority.
Expected parameters include:
category
- the category of the messagepriority
- the priority of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogMessageV( ... )
Expected parameters include:
category
- the category of the messagepriority
- the priority of the messagefmt
- aprintf( ... )
style message format string...
- additional parameters matching%
tokens in thefmt
string, if any
SDL_LogGetOutputFunction( ... )
Get the current log output function.
Expected parameters include:
callback
- pointer which will be filled in with the current log callbackuserdata
- a pointer which will be filled in with the pointer that is passed tocallback
SDL_LogSetOutputFunction( ... )
Replace the default log output function with one of your own.
Expected parameters include:
callback
- anSDL_LogOutputFunction
to call instead of the defaultuserdata
- a pointer that is passed tocallback
Defined Values and Enumerations
These might be imported with the given tag, by name, or with the <:log> tag.
SDL_MAX_LOG_MESSAGE
The maximum size of a log message.
Messages longer than the maximum size will be truncated.
SDL_LogCategory
The predefined log categories
By default the application category is enabled at the INFO level, the assert category is enabled at the WARN level, test is enabled at the VERBOSE level and all other categories are enabled at the CRITICAL
level.
SDL_LOG_CATEGORY_APPLICATION
SDL_LOG_CATEGORY_ERROR
SDL_LOG_CATEGORY_ASSERT
SDL_LOG_CATEGORY_SYSTEM
SDL_LOG_CATEGORY_AUDIO
SDL_LOG_CATEGORY_VIDEO
SDL_LOG_CATEGORY_RENDER
SDL_LOG_CATEGORY_INPUT
SDL_LOG_CATEGORY_TEST
SDL_LOG_CATEGORY_RESERVED1
- These are reserved for future SDL library useSDL_LOG_CATEGORY_RESERVED2
SDL_LOG_CATEGORY_RESERVED3
SDL_LOG_CATEGORY_RESERVED4
SDL_LOG_CATEGORY_RESERVED5
SDL_LOG_CATEGORY_RESERVED6
SDL_LOG_CATEGORY_RESERVED7
SDL_LOG_CATEGORY_RESERVED8
SDL_LOG_CATEGORY_RESERVED9
SDL_LOG_CATEGORY_RESERVED10
SDL_LOG_CATEGORY_CUSTOM
-
Beyond this point is reserved for application use, e.g.
enum { MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, MYAPP_CATEGORY_AWESOME2, MYAPP_CATEGORY_AWESOME3, ... };
SDL_LogPriority
The predefined log priorities.
SDL_LOG_PRIORITY_VERBOSE
SDL_LOG_PRIORITY_DEBUG
SDL_LOG_PRIORITY_INFO
SDL_LOG_PRIORITY_WARN
SDL_LOG_PRIORITY_ERROR
SDL_LOG_PRIORITY_CRITICAL
SDL_NUM_LOG_PRIORITIES
SDL_LogOutputFunction
The prototype for the log output callback function.
This function is called by SDL when there is new text to be logged.
Parameters to expect include:
userdata
- what was passed asuserdata
toSDL_LogSetOutputFunction( ... )
category
- the category of the messagepriority
- the priority of the messagemessage
- the message being output
LICENSE
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
AUTHOR
Sanko Robinson <sanko@cpan.org>