freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] priyesh_LogLibrary 17700d4: * include/freetype/internal/ftde


From: Priyesh Kumar
Subject: [freetype2] priyesh_LogLibrary 17700d4: * include/freetype/internal/ftdebug.h (FT_LOG ): Use more relevant
Date: Fri, 21 Aug 2020 02:48:50 -0400 (EDT)

branch: priyesh_LogLibrary
commit 17700d419b0df5182ede6f7161f18e892b7e41bd
Author: Priyeshkkumar <priyeshkkumar@gmail.com>
Commit: Priyeshkkumar <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.
---
 [priyesh]ChangeLog                  | 10 ++++++++++
 include/freetype/internal/ftdebug.h | 11 ++++++-----
 src/base/ftdebug.c                  |  7 +++++--
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/[priyesh]ChangeLog b/[priyesh]ChangeLog
index 9c56dd9..f5e1ddf 100644
--- a/[priyesh]ChangeLog
+++ b/[priyesh]ChangeLog
@@ -1,5 +1,15 @@
 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): 
     Added `DLG_STATIC' for `Debug Static' configuration on both platforms. 
 
diff --git a/include/freetype/internal/ftdebug.h 
b/include/freetype/internal/ftdebug.h
index 7ba06b4..96da630 100644
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -120,8 +120,8 @@ FT_BEGIN_HEADER
 #define FT_LOG( level, varformat )                                         \
           do                                                               \
           {                                                                \
-            const char* ft_component =  FT_LOGGING_TAG( FT_COMPONENT );    \
-            ft_add_tag(ft_component );                              \
+            const char* dlg_tag =  FT_LOGGING_TAG( FT_COMPONENT );         \
+            ft_add_tag( dlg_tag );                                         \
             if( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level )  \
             {                                                              \
               if( custom_output_handler != NULL )                          \
@@ -129,7 +129,7 @@ FT_BEGIN_HEADER
               else                                                         \
                 dlg_trace varformat;                                       \
             }                                                              \
-            ft_remove_tag( ft_component );                          \
+            ft_remove_tag( dlg_tag );                                      \
           }while( 0 )
 
 #else 
@@ -276,9 +276,10 @@ ft_remove_tag( const char* tag );
 #define FT_ERROR( varformat )                                               \
           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_remove_tag( "error_log", NULL );                              \
+          ft_remove_tag( dlg_tag );                                         \
           } while ( 0 )                            
 
 #else
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index 6716322..3e6b67a 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -444,8 +444,7 @@ else
 
   /*************************************************************************
    * 
-   * TODO:
-   * 1. Add support for priniting FT_COMPONENT
+   * An Output log handler specific to FreeType used by dlg library. 
    *    
    */
   FT_BASE_DEF( void ) 
@@ -488,6 +487,8 @@ else
   FT_EXPORT_DEF( void )
   FT_Trace_Set_Level( const char* level )
   {  
+    ft_component_flag = NULL;
+    ft_timestamp_flag = NULL;
     ft_custom_trace_level = level;
     ft_debug_init();
   }
@@ -495,6 +496,8 @@ else
   FT_EXPORT_DEF( void )
   FT_Trace_Set_Default_Level( void )
   {
+    ft_component_flag = NULL;
+    ft_timestamp_flag = NULL;
     ft_custom_trace_level = NULL ;
     ft_debug_init();
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]