Added a simple log message API
authorSam Lantinga <slouken@libsdl.org>
Mon, 07 Feb 2011 16:45:40 -0800
changeset 52212ee8112bfc6b
parent 5220 1fbe1c202501
child 5222 c66b2a778b7e
Added a simple log message API
Makefile.in
VisualC/SDL/SDL_VS2008.vcproj
VisualC/SDL/SDL_VS2010.vcxproj
VisualCE/SDL/SDL.vcproj
Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
Xcode/SDL/SDL.xcodeproj/project.pbxproj
include/SDL.h
include/SDL_error.h
include/SDL_log.h
src/SDL.c
src/SDL_error.c
src/SDL_log.c
src/render/SDL_render.c
     1.1 --- a/Makefile.in	Mon Feb 07 10:40:21 2011 -0800
     1.2 +++ b/Makefile.in	Mon Feb 07 16:45:40 2011 -0800
     1.3 @@ -59,6 +59,7 @@
     1.4  	SDL_keyboard.h \
     1.5  	SDL_keysym.h \
     1.6  	SDL_loadso.h \
     1.7 +	SDL_log.h \
     1.8  	SDL_main.h \
     1.9  	SDL_mouse.h \
    1.10  	SDL_mutex.h \
     2.1 --- a/VisualC/SDL/SDL_VS2008.vcproj	Mon Feb 07 10:40:21 2011 -0800
     2.2 +++ b/VisualC/SDL/SDL_VS2008.vcproj	Mon Feb 07 16:45:40 2011 -0800
     2.3 @@ -458,6 +458,10 @@
     2.4  				>
     2.5  			</File>
     2.6  			<File
     2.7 +				RelativePath="..\..\include\SDL_log.h"
     2.8 +				>
     2.9 +			</File>
    2.10 +			<File
    2.11  				RelativePath="..\..\include\SDL_main.h"
    2.12  				>
    2.13  			</File>
    2.14 @@ -919,6 +923,10 @@
    2.15  			>
    2.16  		</File>
    2.17  		<File
    2.18 +			RelativePath="..\..\src\SDL_log.c"
    2.19 +			>
    2.20 +		</File>
    2.21 +		<File
    2.22  			RelativePath="..\..\src\stdlib\SDL_malloc.c"
    2.23  			>
    2.24  		</File>
     3.1 --- a/VisualC/SDL/SDL_VS2010.vcxproj	Mon Feb 07 10:40:21 2011 -0800
     3.2 +++ b/VisualC/SDL/SDL_VS2010.vcxproj	Mon Feb 07 16:45:40 2011 -0800
     3.3 @@ -249,6 +249,7 @@
     3.4      <ClInclude Include="..\..\include\SDL_keyboard.h" />
     3.5      <ClInclude Include="..\..\include\SDL_keysym.h" />
     3.6      <ClInclude Include="..\..\include\SDL_loadso.h" />
     3.7 +    <ClInclude Include="..\..\include\SDL_log.h" />
     3.8      <ClInclude Include="..\..\include\SDL_main.h" />
     3.9      <ClInclude Include="..\..\include\SDL_mouse.h" />
    3.10      <ClInclude Include="..\..\include\SDL_mutex.h" />
    3.11 @@ -390,6 +391,7 @@
    3.12      <ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
    3.13      <ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
    3.14      <ClCompile Include="..\..\src\SDL_hints.c" />
    3.15 +    <ClCompile Include="..\..\src\SDL_log.c" />
    3.16      <ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
    3.17      <ClCompile Include="..\..\src\video\SDL_blit.c" />
    3.18      <ClCompile Include="..\..\src\video\SDL_blit_0.c" />
     4.1 --- a/VisualCE/SDL/SDL.vcproj	Mon Feb 07 10:40:21 2011 -0800
     4.2 +++ b/VisualCE/SDL/SDL.vcproj	Mon Feb 07 16:45:40 2011 -0800
     4.3 @@ -878,6 +878,10 @@
     4.4  				>
     4.5  			</File>
     4.6  			<File
     4.7 +				RelativePath="..\..\src\SDL_hints.c"
     4.8 +				>
     4.9 +			</File>
    4.10 +			<File
    4.11  				RelativePath="..\..\src\stdlib\SDL_iconv.c"
    4.12  				>
    4.13  			</File>
    4.14 @@ -890,6 +894,10 @@
    4.15  				>
    4.16  			</File>
    4.17  			<File
    4.18 +				RelativePath="..\..\src\SDL_log.c"
    4.19 +				>
    4.20 +			</File>
    4.21 +			<File
    4.22  				RelativePath="..\..\src\stdlib\SDL_malloc.c"
    4.23  				>
    4.24  			</File>
    4.25 @@ -938,7 +946,7 @@
    4.26  				>
    4.27  			</File>
    4.28  			<File
    4.29 -				RelativePath="..\..\src\render\software\SDL_renderer_sw.c"
    4.30 +				RelativePath="..\..\src\render\software\SDL_render_sw.c"
    4.31  				>
    4.32  			</File>
    4.33  			<File
    4.34 @@ -1231,18 +1239,46 @@
    4.35  				>
    4.36  			</File>
    4.37  			<File
    4.38 +				RelativePath="..\..\include\SDL_hints.h"
    4.39 +				>
    4.40 +			</File>
    4.41 +			<File
    4.42 +				RelativePath="..\..\include\SDL_input.h"
    4.43 +				>
    4.44 +			</File>
    4.45 +			<File
    4.46 +				RelativePath="..\..\include\SDL_joystick.h"
    4.47 +				>
    4.48 +			</File>
    4.49 +			<File
    4.50  				RelativePath="..\..\src\joystick\SDL_joystick_c.h"
    4.51  				>
    4.52  			</File>
    4.53  			<File
    4.54 +				RelativePath="..\..\include\SDL_keyboard.h"
    4.55 +				>
    4.56 +			</File>
    4.57 +			<File
    4.58  				RelativePath="..\..\src\events\SDL_keyboard_c.h"
    4.59  				>
    4.60  			</File>
    4.61  			<File
    4.62 +				RelativePath="..\..\include\SDL_keysym.h"
    4.63 +				>
    4.64 +			</File>
    4.65 +			<File
    4.66  				RelativePath="..\..\src\video\SDL_leaks.h"
    4.67  				>
    4.68  			</File>
    4.69  			<File
    4.70 +				RelativePath="..\..\include\SDL_loadso.h"
    4.71 +				>
    4.72 +			</File>
    4.73 +			<File
    4.74 +				RelativePath="..\..\include\SDL_log.h"
    4.75 +				>
    4.76 +			</File>
    4.77 +			<File
    4.78  				RelativePath="..\..\src\events\SDL_mouse_c.h"
    4.79  				>
    4.80  			</File>
    4.81 @@ -1271,6 +1307,10 @@
    4.82  				>
    4.83  			</File>
    4.84  			<File
    4.85 +				RelativePath="..\..\src\render\software\SDL_render_sw_c.h"
    4.86 +				>
    4.87 +			</File>
    4.88 +			<File
    4.89  				RelativePath="..\..\src\render\software\SDL_renderer_sw_c.h"
    4.90  				>
    4.91  			</File>
     5.1 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 10:40:21 2011 -0800
     5.2 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 16:45:40 2011 -0800
     5.3 @@ -99,6 +99,9 @@
     5.4  		04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; };
     5.5  		04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
     5.6  		04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7C11EF497E00B60E01 /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
     5.7 +		04BAC0991300C0F70055DE28 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC0981300C0F70055DE28 /* SDL_log.h */; };
     5.8 +		04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */; };
     5.9 +		04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC09B1300C1290055DE28 /* SDL_log.c */; };
    5.10  		04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */; settings = {ATTRIBUTES = (Public, ); }; };
    5.11  		04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
    5.12  		04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
    5.13 @@ -362,6 +365,9 @@
    5.14  		04BA9D6211EF474A00B60E01 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = "<group>"; };
    5.15  		04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; };
    5.16  		04BA9D7C11EF497E00B60E01 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_touch.h; path = ../../include/SDL_touch.h; sourceTree = SOURCE_ROOT; };
    5.17 +		04BAC0981300C0F70055DE28 /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_log.h; path = ../../include/SDL_log.h; sourceTree = SOURCE_ROOT; };
    5.18 +		04BAC09A1300C1290055DE28 /* SDL_assert_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert_c.h; path = ../../src/SDL_assert_c.h; sourceTree = SOURCE_ROOT; };
    5.19 +		04BAC09B1300C1290055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
    5.20  		04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_iphoneos.h; path = ../../include/SDL_config_iphoneos.h; sourceTree = SOURCE_ROOT; };
    5.21  		04F2AF531104ABC300D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; };
    5.22  		04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
    5.23 @@ -930,6 +936,7 @@
    5.24  				FD99B8DF0DD52EB400FB1D6B /* SDL_keyboard.h */,
    5.25  				FD99B8E00DD52EB400FB1D6B /* SDL_keysym.h */,
    5.26  				FD99B8E10DD52EB400FB1D6B /* SDL_loadso.h */,
    5.27 +				04BAC0981300C0F70055DE28 /* SDL_log.h */,
    5.28  				FD99B8E20DD52EB400FB1D6B /* SDL_main.h */,
    5.29  				FD99B8E30DD52EB400FB1D6B /* SDL_mouse.h */,
    5.30  				FD99B8E40DD52EB400FB1D6B /* SDL_mutex.h */,
    5.31 @@ -978,12 +985,14 @@
    5.32  				FD99BA1E0DD52EDC00FB1D6B /* timer */,
    5.33  				FDA682420DF2374D00F98A1A /* video */,
    5.34  				04F2AF551104ABD200D6DDF7 /* SDL_assert.c */,
    5.35 +				04BAC09A1300C1290055DE28 /* SDL_assert_c.h */,
    5.36  				FD99B9D30DD52EDC00FB1D6B /* SDL_compat.c */,
    5.37  				FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */,
    5.38  				FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */,
    5.39  				FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.c */,
    5.40  				FD99B9D70DD52EDC00FB1D6B /* SDL_fatal.h */,
    5.41  				0442EC5412FE1C3F004C9285 /* SDL_hints.c */,
    5.42 +				04BAC09B1300C1290055DE28 /* SDL_log.c */,
    5.43  				FD99B9D80DD52EDC00FB1D6B /* SDL.c */,
    5.44  			);
    5.45  			name = "Library Source";
    5.46 @@ -1260,6 +1269,8 @@
    5.47  				0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */,
    5.48  				0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */,
    5.49  				04043B8D12FEA9350076DB1F /* SDL_opengles2.h in Headers */,
    5.50 +				04BAC0991300C0F70055DE28 /* SDL_log.h in Headers */,
    5.51 +				04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */,
    5.52  			);
    5.53  			runOnlyForDeploymentPostprocessing = 0;
    5.54  		};
    5.55 @@ -1509,6 +1520,7 @@
    5.56  				0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */,
    5.57  				0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
    5.58  				0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
    5.59 +				04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
    5.60  			);
    5.61  			runOnlyForDeploymentPostprocessing = 0;
    5.62  		};
     6.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Mon Feb 07 10:40:21 2011 -0800
     6.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Mon Feb 07 16:45:40 2011 -0800
     6.3 @@ -155,6 +155,10 @@
     6.4  		044E5F8611E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; };
     6.5  		0469A10B12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
     6.6  		0469A10D12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; };
     6.7 +		04BAC0B31300C1CB0055DE28 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC0B21300C1CB0055DE28 /* SDL_log.h */; };
     6.8 +		04BAC0B41300C1CB0055DE28 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC0B21300C1CB0055DE28 /* SDL_log.h */; };
     6.9 +		04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
    6.10 +		04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
    6.11  		04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
    6.12  		04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
    6.13  		04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
    6.14 @@ -709,6 +713,8 @@
    6.15  		0442EC5E12FE1C75004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; };
    6.16  		044E5F8411E6051C0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; };
    6.17  		0469A10912EE4BF100B846D6 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = ../../include/SDL_blendmode.h; sourceTree = SOURCE_ROOT; };
    6.18 +		04BAC0B21300C1CB0055DE28 /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_log.h; path = ../../include/SDL_log.h; sourceTree = SOURCE_ROOT; };
    6.19 +		04BAC0C71300C2160055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
    6.20  		04BDFD7412E6671700899322 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
    6.21  		04BDFD7512E6671700899322 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
    6.22  		04BDFD8812E6671700899322 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = "<group>"; };
    6.23 @@ -1137,6 +1143,7 @@
    6.24  				0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */,
    6.25  				0C5AF5F201191D2B7F000001 /* SDL_keysym.h */,
    6.26  				B29A290D04E5B28700A80002 /* SDL_loadso.h */,
    6.27 +				04BAC0B21300C1CB0055DE28 /* SDL_log.h */,
    6.28  				0C5AF5F301191D2B7F000001 /* SDL_main.h */,
    6.29  				0C5AF5F401191D2B7F000001 /* SDL_mouse.h */,
    6.30  				0C5AF5F501191D2B7F000001 /* SDL_mutex.h */,
    6.31 @@ -1722,6 +1729,7 @@
    6.32  				04BDFE5A12E6671700899322 /* SDL_fatal.c */,
    6.33  				04BDFE5B12E6671700899322 /* SDL_fatal.h */,
    6.34  				0442EC5E12FE1C75004C9285 /* SDL_hints.c */,
    6.35 +				04BAC0C71300C2160055DE28 /* SDL_log.c */,
    6.36  				04BDFE5C12E6671700899322 /* SDL.c */,
    6.37  			);
    6.38  			name = "Library Source";
    6.39 @@ -1932,6 +1940,7 @@
    6.40  				0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
    6.41  				0442EC5B12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */,
    6.42  				04043BBB12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */,
    6.43 +				04BAC0B31300C1CB0055DE28 /* SDL_log.h in Headers */,
    6.44  			);
    6.45  			runOnlyForDeploymentPostprocessing = 0;
    6.46  		};
    6.47 @@ -2061,6 +2070,7 @@
    6.48  				0442EC1E12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
    6.49  				0442EC5D12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */,
    6.50  				04043BBC12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */,
    6.51 +				04BAC0B41300C1CB0055DE28 /* SDL_log.h in Headers */,
    6.52  			);
    6.53  			runOnlyForDeploymentPostprocessing = 0;
    6.54  		};
    6.55 @@ -2431,6 +2441,7 @@
    6.56  				0442EC1D12FE1BCB004C9285 /* SDL_render_sw.c in Sources */,
    6.57  				0442EC5A12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */,
    6.58  				0442EC5F12FE1C75004C9285 /* SDL_hints.c in Sources */,
    6.59 +				04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */,
    6.60  			);
    6.61  			runOnlyForDeploymentPostprocessing = 0;
    6.62  		};
    6.63 @@ -2550,6 +2561,7 @@
    6.64  				0442EC1F12FE1BCB004C9285 /* SDL_render_sw.c in Sources */,
    6.65  				0442EC5C12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */,
    6.66  				0442EC6012FE1C75004C9285 /* SDL_hints.c in Sources */,
    6.67 +				04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */,
    6.68  			);
    6.69  			runOnlyForDeploymentPostprocessing = 0;
    6.70  		};
     7.1 --- a/include/SDL.h	Mon Feb 07 10:40:21 2011 -0800
     7.2 +++ b/include/SDL.h	Mon Feb 07 16:45:40 2011 -0800
     7.3 @@ -81,6 +81,7 @@
     7.4  #include "SDL_events.h"
     7.5  #include "SDL_hints.h"
     7.6  #include "SDL_loadso.h"
     7.7 +#include "SDL_log.h"
     7.8  #include "SDL_mutex.h"
     7.9  #include "SDL_power.h"
    7.10  #include "SDL_render.h"
     8.1 --- a/include/SDL_error.h	Mon Feb 07 10:40:21 2011 -0800
     8.2 +++ b/include/SDL_error.h	Mon Feb 07 16:45:40 2011 -0800
     8.3 @@ -48,7 +48,7 @@
     8.4   *  \name Internal error functions
     8.5   *  
     8.6   *  \internal 
     8.7 - *  Private error message function - used internally.
     8.8 + *  Private error reporting function - used internally.
     8.9   */
    8.10  /*@{*/
    8.11  #define SDL_OutOfMemory()	SDL_Error(SDL_ENOMEM)
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/include/SDL_log.h	Mon Feb 07 16:45:40 2011 -0800
     9.3 @@ -0,0 +1,191 @@
     9.4 +/*
     9.5 +    SDL - Simple DirectMedia Layer
     9.6 +    Copyright (C) 1997-2010 Sam Lantinga
     9.7 +
     9.8 +    This library is free software; you can redistribute it and/or
     9.9 +    modify it under the terms of the GNU Lesser General Public
    9.10 +    License as published by the Free Software Foundation; either
    9.11 +    version 2.1 of the License, or (at your option) any later version.
    9.12 +
    9.13 +    This library is distributed in the hope that it will be useful,
    9.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.16 +    Lesser General Public License for more details.
    9.17 +
    9.18 +    You should have received a copy of the GNU Lesser General Public
    9.19 +    License along with this library; if not, write to the Free Software
    9.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    9.21 +
    9.22 +    Sam Lantinga
    9.23 +    slouken@libsdl.org
    9.24 +*/
    9.25 +
    9.26 +/**
    9.27 + *  \file SDL_log.h
    9.28 + *  
    9.29 + *  Simple log messages with categories and priorities.
    9.30 + *
    9.31 + *  By default logs are quiet, but if you're debugging SDL you might want:
    9.32 + *
    9.33 + *      SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
    9.34 + *
    9.35 + *  Here's where the messages go on different platforms:
    9.36 + *      Windows: debug output stream
    9.37 + *      Android: log output
    9.38 + *      Others: standard error output (stderr)
    9.39 + */
    9.40 +
    9.41 +#ifndef _SDL_log_h
    9.42 +#define _SDL_log_h
    9.43 +
    9.44 +#include "SDL_stdinc.h"
    9.45 +
    9.46 +#include "begin_code.h"
    9.47 +/* Set up for C function definitions, even when using C++ */
    9.48 +#ifdef __cplusplus
    9.49 +/* *INDENT-OFF* */
    9.50 +extern "C" {
    9.51 +/* *INDENT-ON* */
    9.52 +#endif
    9.53 +
    9.54 +
    9.55 +/**
    9.56 + *  \brief The maximum size of a log message
    9.57 + *
    9.58 + *  Messages longer than the maximum size will be truncated
    9.59 + */
    9.60 +#define SDL_MAX_LOG_MESSAGE 4096
    9.61 +
    9.62 +/**
    9.63 + *  \brief The predefined log categories
    9.64 + *
    9.65 + *  By default the application category is enabled at the INFO level,
    9.66 + *  and all other categories are enabled at the CRITICAL level.
    9.67 + */
    9.68 +enum
    9.69 +{
    9.70 +    SDL_LOG_CATEGORY_APPLICATION,
    9.71 +    SDL_LOG_CATEGORY_ERROR,
    9.72 +    SDL_LOG_CATEGORY_SYSTEM,
    9.73 +    SDL_LOG_CATEGORY_AUDIO,
    9.74 +    SDL_LOG_CATEGORY_VIDEO,
    9.75 +    SDL_LOG_CATEGORY_RENDER,
    9.76 +    SDL_LOG_CATEGORY_INPUT,
    9.77 +
    9.78 +    /* Reserved for future SDL library use */
    9.79 +    SDL_LOG_CATEGORY_RESERVED1,
    9.80 +    SDL_LOG_CATEGORY_RESERVED2,
    9.81 +    SDL_LOG_CATEGORY_RESERVED3,
    9.82 +    SDL_LOG_CATEGORY_RESERVED4,
    9.83 +    SDL_LOG_CATEGORY_RESERVED5,
    9.84 +    SDL_LOG_CATEGORY_RESERVED6,
    9.85 +    SDL_LOG_CATEGORY_RESERVED7,
    9.86 +    SDL_LOG_CATEGORY_RESERVED8,
    9.87 +    SDL_LOG_CATEGORY_RESERVED9,
    9.88 +    SDL_LOG_CATEGORY_RESERVED10,
    9.89 +
    9.90 +    /* Beyond this point is reserved for application use, e.g.
    9.91 +       enum {
    9.92 +           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
    9.93 +           MYAPP_CATEGORY_AWESOME2,
    9.94 +           MYAPP_CATEGORY_AWESOME3,
    9.95 +           ...
    9.96 +       };
    9.97 +     */
    9.98 +    SDL_LOG_CATEGORY_CUSTOM,
    9.99 +};
   9.100 +
   9.101 +/**
   9.102 + *  \brief The predefined log priorities
   9.103 + */
   9.104 +typedef enum
   9.105 +{
   9.106 +    SDL_LOG_PRIORITY_VERBOSE = 1,
   9.107 +    SDL_LOG_PRIORITY_DEBUG,
   9.108 +    SDL_LOG_PRIORITY_INFO,
   9.109 +    SDL_LOG_PRIORITY_WARN,
   9.110 +    SDL_LOG_PRIORITY_ERROR,
   9.111 +    SDL_LOG_PRIORITY_CRITICAL,
   9.112 +    SDL_NUM_LOG_PRIORITIES
   9.113 +} SDL_LogPriority;
   9.114 +
   9.115 +
   9.116 +/**
   9.117 + *  \brief Set the priority of all log categories
   9.118 + */
   9.119 +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
   9.120 +
   9.121 +/**
   9.122 + *  \brief Set the priority of a particular log category
   9.123 + */
   9.124 +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
   9.125 +                                                SDL_LogPriority priority);
   9.126 +
   9.127 +/**
   9.128 + *  \brief Set the priority of a particular log category
   9.129 + */
   9.130 +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
   9.131 +
   9.132 +/**
   9.133 + *  \brief Reset all priorities to default.
   9.134 + *
   9.135 + *  \note This is called in SDL_Quit().
   9.136 + */
   9.137 +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
   9.138 +
   9.139 +/**
   9.140 + *  \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
   9.141 + */
   9.142 +extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...);
   9.143 +
   9.144 +/**
   9.145 + *  \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
   9.146 + */
   9.147 +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...);
   9.148 +
   9.149 +/**
   9.150 + *  \brief Log a message with SDL_LOG_PRIORITY_INFO
   9.151 + */
   9.152 +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...);
   9.153 +
   9.154 +/**
   9.155 + *  \brief Log a message with SDL_LOG_PRIORITY_WARN
   9.156 + */
   9.157 +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...);
   9.158 +
   9.159 +/**
   9.160 + *  \brief Log a message with SDL_LOG_PRIORITY_ERROR
   9.161 + */
   9.162 +extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...);
   9.163 +
   9.164 +/**
   9.165 + *  \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
   9.166 + */
   9.167 +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...);
   9.168 +
   9.169 +/**
   9.170 + *  \brief Log a message with the specified category and priority.
   9.171 + */
   9.172 +extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
   9.173 +                                            SDL_LogPriority priority,
   9.174 +                                            const char *fmt, ...);
   9.175 +
   9.176 +/**
   9.177 + *  \brief Log a message with the specified category and priority.
   9.178 + */
   9.179 +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
   9.180 +                                             SDL_LogPriority priority,
   9.181 +                                             const char *fmt, va_list ap);
   9.182 +
   9.183 +
   9.184 +/* Ends C function definitions when using C++ */
   9.185 +#ifdef __cplusplus
   9.186 +/* *INDENT-OFF* */
   9.187 +}
   9.188 +/* *INDENT-ON* */
   9.189 +#endif
   9.190 +#include "close_code.h"
   9.191 +
   9.192 +#endif /* _SDL_log_h */
   9.193 +
   9.194 +/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/SDL.c	Mon Feb 07 10:40:21 2011 -0800
    10.2 +++ b/src/SDL.c	Mon Feb 07 16:45:40 2011 -0800
    10.3 @@ -215,22 +215,12 @@
    10.4  SDL_Quit(void)
    10.5  {
    10.6      /* Quit all subsystems */
    10.7 -#ifdef DEBUG_BUILD
    10.8 -    printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n");
    10.9 -    fflush(stdout);
   10.10 -#endif
   10.11 -
   10.12  #if defined(__WIN32__)
   10.13      SDL_HelperWindowDestroy();
   10.14  #endif
   10.15      SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
   10.16  
   10.17  #ifdef CHECK_LEAKS
   10.18 -#ifdef DEBUG_BUILD
   10.19 -    printf("[SDL_Quit] : CHECK_LEAKS\n");
   10.20 -    fflush(stdout);
   10.21 -#endif
   10.22 -
   10.23      /* !!! FIXME: make this an assertion. */
   10.24      /* Print the number of surfaces not freed */
   10.25      if (surfaces_allocated != 0) {
   10.26 @@ -238,22 +228,13 @@
   10.27                  surfaces_allocated);
   10.28      }
   10.29  #endif
   10.30 -#ifdef DEBUG_BUILD
   10.31 -    printf("[SDL_Quit] : SDL_UninstallParachute()\n");
   10.32 -    fflush(stdout);
   10.33 -#endif
   10.34  
   10.35      /* Uninstall any parachute signal handlers */
   10.36      SDL_UninstallParachute();
   10.37  
   10.38      SDL_ClearHints();
   10.39      SDL_AssertionsQuit();
   10.40 -
   10.41 -#ifdef DEBUG_BUILD
   10.42 -    printf("[SDL_Quit] : Returning!\n");
   10.43 -    fflush(stdout);
   10.44 -#endif
   10.45 -
   10.46 +    SDL_LogResetPriorities();
   10.47  }
   10.48  
   10.49  /* Get the library version number */
    11.1 --- a/src/SDL_error.c	Mon Feb 07 10:40:21 2011 -0800
    11.2 +++ b/src/SDL_error.c	Mon Feb 07 16:45:40 2011 -0800
    11.3 @@ -23,14 +23,10 @@
    11.4  
    11.5  /* Simple error handling in SDL */
    11.6  
    11.7 -#ifdef __ANDROID__
    11.8 -#include <android/log.h>
    11.9 -#endif
   11.10 -
   11.11 +#include "SDL_log.h"
   11.12  #include "SDL_error.h"
   11.13  #include "SDL_error_c.h"
   11.14  
   11.15 -/*#define DEBUG_ERROR*/
   11.16  
   11.17  /* Routine to get the thread-specific error variable */
   11.18  #if SDL_THREADS_DISABLED
   11.19 @@ -113,12 +109,7 @@
   11.20      va_end(ap);
   11.21  
   11.22      /* If we are in debug mode, print out an error message */
   11.23 -#ifdef DEBUG_ERROR
   11.24 -    fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
   11.25 -#ifdef __ANDROID__
   11.26 -    __android_log_print(ANDROID_LOG_INFO, "SDL", "ERROR: %s", SDL_GetError());
   11.27 -#endif
   11.28 -#endif /* DEBUG_ERROR */
   11.29 +    SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError());
   11.30  }
   11.31  
   11.32  /* This function has a bit more overhead than most error functions
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/src/SDL_log.c	Mon Feb 07 16:45:40 2011 -0800
    12.3 @@ -0,0 +1,273 @@
    12.4 +/*
    12.5 +    SDL - Simple DirectMedia Layer
    12.6 +    Copyright (C) 1997-2010 Sam Lantinga
    12.7 +
    12.8 +    This library is free software; you can redistribute it and/or
    12.9 +    modify it under the terms of the GNU Lesser General Public
   12.10 +    License as published by the Free Software Foundation; either
   12.11 +    version 2.1 of the License, or (at your option) any later version.
   12.12 +
   12.13 +    This library is distributed in the hope that it will be useful,
   12.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   12.16 +    Lesser General Public License for more details.
   12.17 +
   12.18 +    You should have received a copy of the GNU Lesser General Public
   12.19 +    License along with this library; if not, write to the Free Software
   12.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   12.21 +
   12.22 +    Sam Lantinga
   12.23 +    slouken@libsdl.org
   12.24 +*/
   12.25 +#include "SDL_config.h"
   12.26 +
   12.27 +/* Simple log messages in SDL */
   12.28 +
   12.29 +#include "SDL_log.h"
   12.30 +
   12.31 +#if HAVE_STDIO_H
   12.32 +#include <stdio.h>
   12.33 +#endif
   12.34 +
   12.35 +#if defined(__WIN32__)
   12.36 +#include "core/windows/SDL_windows.h"
   12.37 +#elif defined(__ANDROID__)
   12.38 +#include <android/log.h>
   12.39 +#endif
   12.40 +
   12.41 +#define DEFAULT_PRIORITY                SDL_LOG_PRIORITY_CRITICAL
   12.42 +#define DEFAULT_APPLICATION_PRIORITY    SDL_LOG_PRIORITY_INFO
   12.43 +
   12.44 +typedef struct SDL_LogLevel
   12.45 +{
   12.46 +    int category;
   12.47 +    SDL_LogPriority priority;
   12.48 +    struct SDL_LogLevel *next;
   12.49 +} SDL_LogLevel;
   12.50 +
   12.51 +static SDL_LogLevel *SDL_loglevels;
   12.52 +static SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY;
   12.53 +static SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY;
   12.54 +
   12.55 +static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES] = {
   12.56 +    "VERBOSE",
   12.57 +    "DEBUG",
   12.58 +    "INFO",
   12.59 +    "WARN",
   12.60 +    "ERROR",
   12.61 +    "CRITICAL"
   12.62 +};
   12.63 +
   12.64 +#ifdef __ANDROID__
   12.65 +static const char *SDL_category_prefixes[SDL_LOG_CATEGORY_RESERVED1] = {
   12.66 +    "APP",
   12.67 +    "ERROR",
   12.68 +    "SYSTEM",
   12.69 +    "AUDIO",
   12.70 +    "VIDEO",
   12.71 +    "RENDER",
   12.72 +    "INPUT"
   12.73 +};
   12.74 +
   12.75 +static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = {
   12.76 +    ANDROID_LOG_VERBOSE,
   12.77 +    ANDROID_LOG_DEBUG,
   12.78 +    ANDROID_LOG_INFO,
   12.79 +    ANDROID_LOG_WARN,
   12.80 +    ANDROID_LOG_ERROR,
   12.81 +    ANDROID_LOG_FATAL
   12.82 +};
   12.83 +#endif /* __ANDROID__ */
   12.84 +
   12.85 +
   12.86 +void
   12.87 +SDL_LogSetAllPriority(SDL_LogPriority priority)
   12.88 +{
   12.89 +    SDL_LogLevel *entry;
   12.90 +
   12.91 +    for (entry = SDL_loglevels; entry; entry = entry->next) {
   12.92 +        entry->priority = priority;
   12.93 +    }
   12.94 +    SDL_application_priority = SDL_default_priority = priority;
   12.95 +}
   12.96 +
   12.97 +void
   12.98 +SDL_LogSetPriority(int category, SDL_LogPriority priority)
   12.99 +{
  12.100 +    SDL_LogLevel *entry;
  12.101 +
  12.102 +    for (entry = SDL_loglevels; entry; entry = entry->next) {
  12.103 +        if (entry->category == category) {
  12.104 +            entry->priority = priority;
  12.105 +            return;
  12.106 +        }
  12.107 +    }
  12.108 +
  12.109 +    /* Create a new entry */
  12.110 +    entry = (SDL_LogLevel *)SDL_malloc(sizeof(*entry));
  12.111 +    if (entry) {
  12.112 +        entry->category = category;
  12.113 +        entry->priority = priority;
  12.114 +        entry->next = SDL_loglevels;
  12.115 +        SDL_loglevels = entry;
  12.116 +    }
  12.117 +}
  12.118 +
  12.119 +SDL_LogPriority
  12.120 +SDL_LogGetPriority(int category)
  12.121 +{
  12.122 +    SDL_LogLevel *entry;
  12.123 +
  12.124 +    for (entry = SDL_loglevels; entry; entry = entry->next) {
  12.125 +        if (entry->category == category) {
  12.126 +            return entry->priority;
  12.127 +        }
  12.128 +    }
  12.129 +
  12.130 +    if (category == SDL_LOG_CATEGORY_APPLICATION) {
  12.131 +        return SDL_application_priority;
  12.132 +    } else {
  12.133 +        return SDL_default_priority;
  12.134 +    }
  12.135 +}
  12.136 +
  12.137 +void
  12.138 +SDL_LogResetPriorities(void)
  12.139 +{
  12.140 +    SDL_LogLevel *entry;
  12.141 +
  12.142 +    while (SDL_loglevels) {
  12.143 +        entry = SDL_loglevels;
  12.144 +        SDL_loglevels = entry->next;
  12.145 +        SDL_free(entry);
  12.146 +    }
  12.147 +
  12.148 +    SDL_application_priority = DEFAULT_APPLICATION_PRIORITY;
  12.149 +    SDL_default_priority = DEFAULT_PRIORITY;
  12.150 +}
  12.151 +
  12.152 +void
  12.153 +SDL_Log(const char *fmt, ...)
  12.154 +{
  12.155 +    va_list ap;
  12.156 +
  12.157 +    va_start(ap, fmt);
  12.158 +    SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap);
  12.159 +    va_end(ap);
  12.160 +}
  12.161 +
  12.162 +void
  12.163 +SDL_LogVerbose(int category, const char *fmt, ...)
  12.164 +{
  12.165 +    va_list ap;
  12.166 +
  12.167 +    va_start(ap, fmt);
  12.168 +    SDL_LogMessageV(category, SDL_LOG_PRIORITY_VERBOSE, fmt, ap);
  12.169 +    va_end(ap);
  12.170 +}
  12.171 +
  12.172 +void
  12.173 +SDL_LogInfo(int category, const char *fmt, ...)
  12.174 +{
  12.175 +    va_list ap;
  12.176 +
  12.177 +    va_start(ap, fmt);
  12.178 +    SDL_LogMessageV(category, SDL_LOG_PRIORITY_INFO, fmt, ap);
  12.179 +    va_end(ap);
  12.180 +}
  12.181 +
  12.182 +void
  12.183 +SDL_LogWarn(int category, const char *fmt, ...)
  12.184 +{
  12.185 +    va_list ap;
  12.186 +
  12.187 +    va_start(ap, fmt);
  12.188 +    SDL_LogMessageV(category, SDL_LOG_PRIORITY_WARN, fmt, ap);
  12.189 +    va_end(ap);
  12.190 +}
  12.191 +
  12.192 +void
  12.193 +SDL_LogError(int category, const char *fmt, ...)
  12.194 +{
  12.195 +    va_list ap;
  12.196 +
  12.197 +    va_start(ap, fmt);
  12.198 +    SDL_LogMessageV(category, SDL_LOG_PRIORITY_ERROR, fmt, ap);
  12.199 +    va_end(ap);
  12.200 +}
  12.201 +
  12.202 +void
  12.203 +SDL_LogCritical(int category, const char *fmt, ...)
  12.204 +{
  12.205 +    va_list ap;
  12.206 +
  12.207 +    va_start(ap, fmt);
  12.208 +    SDL_LogMessageV(category, SDL_LOG_PRIORITY_CRITICAL, fmt, ap);
  12.209 +    va_end(ap);
  12.210 +}
  12.211 +
  12.212 +void
  12.213 +SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ...)
  12.214 +{
  12.215 +    va_list ap;
  12.216 +
  12.217 +    va_start(ap, fmt);
  12.218 +    SDL_LogMessageV(category, priority, fmt, ap);
  12.219 +    va_end(ap);
  12.220 +}
  12.221 +
  12.222 +#ifdef __ANDROID__
  12.223 +static const char *
  12.224 +GetCategoryPrefix(int category)
  12.225 +{
  12.226 +    if (category < SDL_LOG_CATEGORY_RESERVED1) {
  12.227 +        return SDL_category_prefixes[category];
  12.228 +    }
  12.229 +    if (category < SDL_LOG_CATEGORY_CUSTOM) {
  12.230 +        return "RESERVED";
  12.231 +    }
  12.232 +    return "CUSTOM";
  12.233 +}
  12.234 +#endif /* __ANDROID__ */
  12.235 +
  12.236 +void
  12.237 +SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap)
  12.238 +{
  12.239 +    char message[SDL_MAX_LOG_MESSAGE];
  12.240 +
  12.241 +    /* Make sure we don't exceed array bounds */
  12.242 +    if (priority < 0 || priority >= SDL_NUM_LOG_PRIORITIES) {
  12.243 +        return;
  12.244 +    }
  12.245 +
  12.246 +    /* See if we want to do anything with this message */
  12.247 +    if (priority < SDL_LogGetPriority(category)) {
  12.248 +        return;
  12.249 +    }
  12.250 +
  12.251 +    SDL_vsnprintf(message, SDL_arraysize(message), fmt, ap);
  12.252 +
  12.253 +#if defined(__WIN32__)
  12.254 +    {
  12.255 +        char output[32+SDL_MAX_LOG_MESSAGE];
  12.256 +        LPTSTR tstr;
  12.257 +
  12.258 +        SDL_snprintf(output, SDL_arraysize(output), "%s: %s", SDL_priority_prefixes[priority], message);
  12.259 +        tstr = WIN_UTF8ToString(output);
  12.260 +        OutputDebugString(tstr);
  12.261 +        SDL_free(tstr);
  12.262 +    }
  12.263 +#elif defined(__ANDROID__)
  12.264 +    {
  12.265 +        char tag[32];
  12.266 +
  12.267 +        SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category));
  12.268 +        __android_log_write(SDL_android_priority[priority], tag, message);
  12.269 +    }
  12.270 +#endif
  12.271 +#if HAVE_STDIO_H
  12.272 +    fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message);
  12.273 +#endif
  12.274 +}
  12.275 +
  12.276 +/* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/render/SDL_render.c	Mon Feb 07 10:40:21 2011 -0800
    13.2 +++ b/src/render/SDL_render.c	Mon Feb 07 16:45:40 2011 -0800
    13.3 @@ -24,6 +24,7 @@
    13.4  /* The SDL 2D rendering system */
    13.5  
    13.6  #include "SDL_hints.h"
    13.7 +#include "SDL_log.h"
    13.8  #include "SDL_render.h"
    13.9  #include "SDL_sysrender.h"
   13.10  #include "../video/SDL_pixels_c.h"
   13.11 @@ -159,6 +160,9 @@
   13.12          renderer->window = window;
   13.13  
   13.14          SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
   13.15 +
   13.16 +        SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
   13.17 +                    "Created renderer: %s", renderer->info.name);
   13.18      }
   13.19      return renderer;
   13.20  }