• <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++
            99久久精品费精品国产一区二区| 久久久久亚洲精品天堂久久久久久| 品成人欧美大片久久国产欧美| 波多野结衣AV无码久久一区| 日本精品一区二区久久久| 国产精品成人久久久久三级午夜电影 | 亚洲午夜精品久久久久久浪潮| 久久99中文字幕久久| 久久99热精品| 岛国搬运www久久| 久久久不卡国产精品一区二区| 久久国产精品免费一区| 久久91精品综合国产首页| 久久se精品一区精品二区国产| 久久一区二区三区免费| 久久久噜噜噜久久| 亚洲精品综合久久| 久久精品国产亚洲AV影院| 亚洲国产另类久久久精品| 久久精品夜夜夜夜夜久久| 精品久久久久久国产| 亚洲国产天堂久久综合网站| 久久久久国产一区二区三区| 国产99久久久国产精品小说| 99久久777色| 久久中文字幕视频、最近更新| 热99RE久久精品这里都是精品免费| 漂亮人妻被黑人久久精品| 亚洲狠狠久久综合一区77777| 婷婷久久综合九色综合绿巨人 | 久久笫一福利免费导航| 亚洲中文字幕无码久久精品1| 日韩欧美亚洲综合久久影院d3| 免费精品久久久久久中文字幕| 国产亚洲美女精品久久久2020| 亚洲一区中文字幕久久| 2020久久精品亚洲热综合一本| 国产欧美久久一区二区| 午夜精品久久久久| 成人精品一区二区久久| 无码专区久久综合久中文字幕|