* include/freetype/internal/ftdebug.h (FT_LOG ): Use more relevant

temporary variable name, to hold the name of FT_COMPONENT.
    (FT_ERROR): Store the name of `FT_COMPONENT' in a temporary variable
    and then pass it as a parameter to `ft_add_tag' and `ft_remove_tag'.

    * src/base/ftdebug.c : Updated Comments.
    (FT_Trace_Set_Level, FT_Trace_Set_Default_Level): Reinitialize the
    values of `ft_timestamp_flag' and `ft_component_flag' every time
    `FT_Trace_Set_Level' and `FT_Trace_Set_Default_Level' is used.
This commit is contained in:
Priyeshkkumar 2020-08-21 12:18:07 +05:30
parent dc3c410a83
commit 17700d419b
3 changed files with 21 additions and 7 deletions

View File

@ -1,5 +1,15 @@
2020-08-21 Priyesh Kumar <priyeshkkumar@gmail.com> 2020-08-21 Priyesh Kumar <priyeshkkumar@gmail.com>
* include/freetype/internal/ftdebug.h (FT_LOG ): Use more relevant
temporary variable name, to hold the name of FT_COMPONENT.
(FT_ERROR): Store the name of `FT_COMPONENT' in a temporary variable
and then pass it as a parameter to `ft_add_tag' and `ft_remove_tag'.
* src/base/ftdebug.c : Updated Comments.
(FT_Trace_Set_Level, FT_Trace_Set_Default_Level): Reinitialize the
values of `ft_timestamp_flag' and `ft_component_flag' every time
`FT_Trace_Set_Level' and `FT_Trace_Set_Default_Level' is used.
* builds/windows/vc2010/freetype.vcxproj (PreprocessorDefinitions): * builds/windows/vc2010/freetype.vcxproj (PreprocessorDefinitions):
Added `DLG_STATIC' for `Debug Static' configuration on both platforms. Added `DLG_STATIC' for `Debug Static' configuration on both platforms.

View File

@ -120,8 +120,8 @@ FT_BEGIN_HEADER
#define FT_LOG( level, varformat ) \ #define FT_LOG( level, varformat ) \
do \ do \
{ \ { \
const char* ft_component = FT_LOGGING_TAG( FT_COMPONENT ); \ const char* dlg_tag = FT_LOGGING_TAG( FT_COMPONENT ); \
ft_add_tag(ft_component ); \ ft_add_tag( dlg_tag ); \
if( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \ if( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
{ \ { \
if( custom_output_handler != NULL ) \ if( custom_output_handler != NULL ) \
@ -129,7 +129,7 @@ FT_BEGIN_HEADER
else \ else \
dlg_trace varformat; \ dlg_trace varformat; \
} \ } \
ft_remove_tag( ft_component ); \ ft_remove_tag( dlg_tag ); \
}while( 0 ) }while( 0 )
#else #else
@ -276,9 +276,10 @@ ft_remove_tag( const char* tag );
#define FT_ERROR( varformat ) \ #define FT_ERROR( varformat ) \
do \ do \
{ \ { \
dlg_add_tag( "error_log", NULL ); \ const char* dlg_tag = FT_LOGGING_TAG( FT_COMPONENT ); \
ft_add_tag( dlg_tag ); \
dlg_trace varformat; \ dlg_trace varformat; \
dlg_remove_tag( "error_log", NULL ); \ ft_remove_tag( dlg_tag ); \
} while ( 0 ) } while ( 0 )
#else #else

View File

@ -444,8 +444,7 @@ else
/************************************************************************* /*************************************************************************
* *
* TODO: * An Output log handler specific to FreeType used by dlg library.
* 1. Add support for priniting FT_COMPONENT
* *
*/ */
FT_BASE_DEF( void ) FT_BASE_DEF( void )
@ -488,6 +487,8 @@ else
FT_EXPORT_DEF( void ) FT_EXPORT_DEF( void )
FT_Trace_Set_Level( const char* level ) FT_Trace_Set_Level( const char* level )
{ {
ft_component_flag = NULL;
ft_timestamp_flag = NULL;
ft_custom_trace_level = level; ft_custom_trace_level = level;
ft_debug_init(); ft_debug_init();
} }
@ -495,6 +496,8 @@ else
FT_EXPORT_DEF( void ) FT_EXPORT_DEF( void )
FT_Trace_Set_Default_Level( void ) FT_Trace_Set_Default_Level( void )
{ {
ft_component_flag = NULL;
ft_timestamp_flag = NULL;
ft_custom_trace_level = NULL ; ft_custom_trace_level = NULL ;
ft_debug_init(); ft_debug_init();
} }