• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            代碼部分

            ? void

            log4cplus :: PropertyConfigurator :: replaceEnvironVariables ()

            {

            std :: vector < log4cplus :: tstring > keys = properties . propertyNames ();

            // 解析屬性文件中的內容 , 需要定義什么是主屬性 , 什么次屬性

            -- 注意 propertyName 以及 substEnvironVars

            ??? std :: vector < log4cplus :: tstring >:: iterator ? it = keys . begin ();

            ??? for (; it != keys . end (); ++ it ) {

            ??????? log4cplus :: tstring ? key = * it ;

            ??????? log4cplus :: tstring ? val = properties . getProperty ( key );

            ??????? log4cplus :: tstring ? subKey = substEnvironVars ( key , getLogLog ());

            ??????? if ( subKey != key ) {

            ??????????? properties . removeProperty ( key );

            ??????????? properties . setProperty ( subKey , val );

            ??????? }

            ??????? log4cplus :: tstring ? subVal = substEnvironVars ( val , getLogLog ());

            ??????? if ( subVal != val ) {

            ??????????? properties . setProperty ( subKey , subVal );

            ??????? }

            ??? }

            }

            void

            log4cplus :: PropertyConfigurator :: configureLoggers ()

            {

            ??? // 定義屬性文件的屬性項

            ??? if ( properties . exists ( LOG4CPLUS_TEXT ( "rootLogger" ) )) {

            ??????? Logger ? root = h . getRoot ();

            ??????? // 加載有關根 log 模塊的信息

            ??????? configureLogger ( root ,

            ??????? properties . getProperty ( LOG4CPLUS_TEXT ( "rootLogger" )));

            ??? }

            ??? // 獲取子屬性部件

            ?? ? Properties ? loggerProperties =

            ??????????? properties . getPropertySubset ( LOG4CPLUS_TEXT ( "logger." ));

            vector < tstring > loggers = loggerProperties . propertyNames ();

            // 注意 ConfigureLogger 部分的內容 , 獲取有關屬性值的描述

            ??? for ( vector < tstring >:: iterator ? it = loggers . begin (); it != loggers . end (); ++ it ) {

            ??????? Logger ? log = getLogger (* it );

            ??????? configureLogger ( log , loggerProperties . getProperty (* it ));

            ??? }

            }

            void

            log4cplus :: PropertyConfigurator :: configureLogger ( log4cplus :: Logger ? logger ,

            ????????????????????????????????????? ??????????? const ? log4cplus :: tstring & config )

            {

            ??? // Remove all spaces from config

            tstring ? configString ;

            // 如何實現 trim 的功能,實現一個范型的方法調用

            ??? remove_copy_if ( config . begin (), config . end (),

            ?????????????????? string_append_iterator < tstring >( configString ),

            ?????????????????? bind1st ( equal_to < tchar >(), ' ' ));

            // "Tokenize" configString

            // 分離字符部分的內容 , 按照 ? “,” 進行分隔

            ??? vector < tstring > tokens ;

            ??? tokenize ( configString , ',' ,

            ???????????? back_insert_iterator < vector < tstring > >( tokens ));

            ??? if ( tokens . size () == 0) {

            ??????? getLogLog (). error (? LOG4CPLUS_TEXT ( "PropertyConfigurator::configureLogger()- Invalid config string(Logger = " )

            ????????????????????????? + logger . getName ()

            ????????????????????????? + LOG4CPLUS_TEXT ( "): \"" )

            ????????????????????????? + config ?

            ????????????????????????? + LOG4CPLUS_TEXT ( "\"" ));

            ??????? return ;

            ??? }

            ?

            Posted on 2006-09-11 15:14 艾凡赫 閱讀(810) 評論(0)  編輯 收藏 引用 所屬分類: C++
            久久精品人人槡人妻人人玩AV| 狠狠色丁香久久婷婷综合五月| 久久精品国产福利国产秒| 91久久精一区二区三区大全| 色综合久久最新中文字幕| 久久人人爽人人爽人人片AV麻豆| 欧美伊人久久大香线蕉综合69| 人妻无码精品久久亚瑟影视| 成人免费网站久久久| 2022年国产精品久久久久| 狠狠狠色丁香婷婷综合久久俺| 国产韩国精品一区二区三区久久| 久久久91精品国产一区二区三区| 久久青青草原综合伊人| 久久久久免费视频| .精品久久久麻豆国产精品| 久久99精品久久只有精品| 亚洲国产二区三区久久| 久久丫精品国产亚洲av不卡| 日本久久中文字幕| 亚洲精品美女久久777777| 久久综合久久鬼色| 亚洲国产另类久久久精品小说 | 久久久国产99久久国产一| 久久亚洲高清观看| 久久99国产一区二区三区| 精品久久久久久| 无码精品久久一区二区三区| 亚洲欧美一级久久精品| 九九热久久免费视频| 久久精品成人欧美大片| 久久综合久久综合亚洲| 久久不见久久见免费视频7| 久久中文字幕视频、最近更新| 亚洲精品蜜桃久久久久久| 久久久精品视频免费观看| 色综合久久久久综合体桃花网| 狠狠色丁香婷婷综合久久来来去| 色欲久久久天天天综合网精品| 人妻系列无码专区久久五月天| 波多野结衣中文字幕久久 |