Too many questions and concerns on java.util.logging package太多的問題和關注java.util.logging包
Too many unanswered questions on logging package.太多懸而未決的問題,測井方案。
Why is the package name a verb?為什麼是軟件包的名稱動詞? Package names should be nouns as can be seen in the rest of the API.包的名稱應名詞中可以看出,在其餘的空氣污染指數。 Why did the author suddenly decide on a verb?為什麼作者突然決定對一個動詞?
How is Logger.getLogger(String name) related to LogManager.getLogManager().getLogger(String name) ?如何logger.getlogger (字符串名稱)有關logmanager.getlogmanager ( ) 。 getlogger (字符串名稱) ? Why is no relationship mentioned in the documentation?為什麼沒有任何關係中提到的文件呢?
Why is LogManager.getLogManager().getLogger(String name) a security concern and Logger.getLogger(String name) is not?為什麼是logmanager.getlogmanager ( ) 。 getlogger (字符串名稱)的安全關切和logger.getlogger (字符串名稱)是不是?
Why isn’ta ErrorManager provided which can be asked about the errors?為什麼不是errormanager提供可詢問有關錯誤?
Why doesn’t MemoryHandler have no method to fetch LogRecord’s?為什麼不memoryhandler沒有方法提取logrecord的? To access a LogRecord there is no simpler way but to create a LogHandler yourself!訪問logrecord是沒有簡單的方式,而是要創造一個loghandler你自己!
Why is Logger.getLogManager() required when we have LogManager.getLogManager()?為什麼是logger.getlogmanager ( )時,如有需要,我們有logmanager.getlogmanager ( ) ?
And finally who designed this?最後,這是誰設計的? And who reviewed this spec?和誰審查這個規格?
Filed under提起下 Headline News頭條新聞 , , Java Software Java軟件 , , Technology技術 | |
| |
RSS 2.0 2.0 | |
Email this Article電子郵件此文章
You may also like to read您也可以想讀 |




April 25th, 2005 at 3:13 am 2005年4月25日在上午03時13分
>…Package names should be nouns… > …包名稱應名詞…
I agree.我同意這一點。 However, I don’t see it as a big problem.不過,我不認為這是一個很大的問題。
>How is Logger.getLogger(String name) related to LogManager.getLogManager().getLogger(String name) ? >是如何logger.getlogger (字符串名稱)有關logmanager.getlogmanager ( ) 。 getlogger (字符串名稱) ?
As you may know, the former is a convenience method for the latter.如您所知,前者是方便的方法為後者。 There should be a link in the JavaDoc.應該有一個鏈接,在javadoc 。 However, I think it’s pretty clear.不過,我覺得這是很清楚。 I’m no Einstein and it took me about 3 seconds to realize the relationsship based on the current doc.我沒有愛因斯坦和我花了大約3秒鐘,以實現relationsship的基礎上,目前的文件。
And I like the convenience method.和我喜歡的方便的方法。 I like that I don’t need to import 2 classes.我想,我並不需要進口2班。
>Why is Logger.getLogManager() required when we have LogManager.getLogManager()? >為什麼是logger.getlogmanager ( )時,如有需要,我們有logmanager.getlogmanager ( ) ?
Yeah, I kinda agree on this one.是啊,我kinda同意就這一個。
>Why isn’ta ErrorManager provided which can be asked about the errors? >為什麼不是errormanager提供可詢問有關錯誤?
You have the exception and the message.你有沒有例外的訊息。 What else do you need?還有什麼你是否有需要?
>Why doesn’t MemoryHandler have no method to fetch LogRecord’s? >為什麼不memoryhandler沒有方法提取logrecord的? To access a LogRecord there is no simpler way but to create a LogHandler yourself!訪問logrecord是沒有簡單的方式,而是要創造一個loghandler你自己!
I don’t see the need here.我不認為有必要在這裡。 Sounds like you want to peek into the encapsulated data.聽起來像你想聚醚醚酮到封裝的數據。 Perhaps you are looking for more functinality than just plain logging; You want to query the logging data too.或許你正在尋找更多的functinality不僅僅是平原測井;您想要查詢的測井數據。 That’s really beyond the scope of what a logging API *must* provide to the runtime environment.這是真的範圍以外的什麼測井空氣污染指數*必須*提供給運行環境。
Have you seen the other Java API’s?你見過其他的Java API的呢? This one is pretty nice compared to most of the rest of them.這是一個相當不錯相比,其餘大部分他們。
April 25th, 2005 at 9:40 am 2005年4月25日在上午09時40分
logging測井
noun : the work of cutting down trees for timber名詞:工作削減樹木木材
April 25th, 2005 at 1:14 pm 2005年4月25日在下午1時14分
>Why is the package name a verb? >為什麼是軟件包的名稱動詞? Package names包名稱
>should be nouns as can be seen in the rest of the >應該是名詞中可以看出,在其餘的
>API. >空氣污染指數。 Why did the author suddenly decide on a verb?為什麼作者突然決定對一個動詞?
It’s hard to say when it’s not used in the context of a sentence, but one could argue that “logging” is a gerund (which is in fact a noun).它的就很難說了,當它的不使用語境中的句子,但可以說“記錄”是一個動名詞(這實際上是名詞) 。 See看見 http://www.bartleby.com/64/C001/028.html http://www.bartleby.com/64/c001/028.html
April 25th, 2005 at 2:52 pm 2005年4月25日在下午2時52分
@Brian In that context, yes. @布賴恩在此背景下,是的。 But in our context it is a verb.但在我國,它是動詞。 Please see below.請參閱下文。
@Alexander @亞歷山大
Bartleby says: bartleby說:
VERB: Inflected forms: logged, log·ging, logs動詞: inflected形式:登錄,登錄高齡化,原木
http://www.bartleby.com/61/86/L0228600.html http://www.bartleby.com/61/86/l0228600.html
@Michael @邁克爾
> I agree. >我同意。 However, I don’t see it as a big problem.不過,我不認為這是一個很大的問題。
It breaks the semantics of usage.它打破了語義的使用。
> Have you seen the other Java API’s? >你見過其他的Java API的呢? This one is pretty nice compared to most of the rest of them.這是一個相當不錯相比,其餘大部分他們。
Seen quite a lot actually since 1996看到了不少,其實自1996年以來,
I wasn’t intending on an ugliness contest, but seriously which ones do you find uglier?我是不打算對一醜競賽,但認真哪些你覺得uglier ?
> I’m no Einstein and it took me about 3 seconds to realize the relationsship based on the current doc. >我沒有愛因斯坦和我花了大約3秒鐘,以實現relationsship的基礎上,目前的文件。
Care to explain you line of reasoning?護理解釋你的推理路線?
> You have the exception and the message. >你有沒有例外的訊息。 What else do you need?還有什麼你是否有需要?
The problem is to process errors pprogramatically, I would have to subclass ErrorManager.問題是錯誤的過程中pprogramatically ,我便要子errormanager 。 I expected a default implementation would at least provide a means to access the data.我預想的默認執行將至少提供了一種手段,來存取數據。 Is that too much to ask?是太多的要求呢?
> I don’t see the need here. >我不認為有必要在這裡。 Sounds like you want to peek into the encapsulated data.聽起來像你想聚醚醚酮到封裝的數據。
Again the question is usability.再次,問題是可用性。 A common usage of MemoryManager would be to capture Exceptions and process them later at leisure.一個共同的使用memorymanager將捕獲的例外情況和過程,他們在稍後的康樂。 At that point I need some way to be able to access the data, which having to subclass.在這一點上我需要一些方法,能夠獲得的數據,而不必子。 It is not a question of breaking encapsulation.問題不在於打破封裝。 The class does nothing with the data, other then to pass it to another handler.階級並沒有與數據,其他,然後通過它到另一個處理程序。 This is a dumb implementation.這是一個啞巴的執行情況。 Looging is about accessing the logged data at the very core. looging是關於存取記錄的數據在非常核心。 The API fails consistently there.空氣污染指數始終未能有。
April 25th, 2005 at 4:45 pm 2005年4月25日在下午4時45分
Disclaimer: I’ma C++ programmer and have no experience with java.util.logging.免責聲明:我的C + +程序員,也沒有任何的經驗與java.util.logging 。 That said, I still think I’m right儘管如此,我仍然認為我的權利
>VERB: Inflected forms: logged, log·ging, logs >動詞: inflected形式:登錄,登錄高齡化,原木
Since just about any verb can be turned into a gerund, most dictionaries aren’t going to call out that fact in every entry.由於只是對任何動詞可以轉化為一動名詞,最字典,不是去呼籲指出,事實上,在每一個項目。 It doesn’t mean it can’t be a gerund (and thus a noun) in the right usage.這並不意味著它不可能是一個動名詞(從而名詞)在正確的用法。
>It breaks the semantics of usage. > ,它打破了語義的使用。
I disagree.我不同意。 The whole point of making package, class, and variable names nouns and method names verbs is to easily and unambiguosly tell where the action is (in the method).整個點,使包裝,階級,和變數名稱名詞和動詞的方法,名稱是很容易和unambiguosly告訴那裡的行動是(在方法) 。 Using “log” as an example, I can very easily see somebody creating a method with the name of “log()” (a verb in this context) that inserts a vlog record into some sort of repository.使用“日誌”作為一個例子,我可以很容易看到有人創建一個方法的名稱“日誌( ) ” (一個動詞,在這方面)插入一個vlog記錄到某種形式的儲存庫。 Given this common verb usage of “log”, it become a less than ideal choice for a package name.鑑於這一共同的動詞使用的“日誌” ,它成為一個不到理想的選擇一個軟件包的名稱。 On the other hand, “logging” is in fact an unambiguous noun (gerund) in this context.在另一方面, “伐木” ,其實是一個毫不含糊的名詞(動名詞)在這方面。 I can’t possibly imagine anybody creating a method called “logging()”.我不可能想像任何人創造的一種方法,所謂“記錄( ) ” 。 It’s the wrong tense as a verb.它的錯誤的緊張,作為一個動詞。 You don’t logging something, you log it.你不記錄下一些東西,您的日誌。 Doing so is the act of logging (a noun in this context).這樣做是該法測井(名詞在這方面) 。
April 25th, 2005 at 6:03 pm 2005年4月25日在下午6時03分
I have a better question, why is the design upside down?我有一個更好的問題,為什麼是設計倒? Why were levels used instead of digitial taxonomy?為什麼各級使用,而非數位分類?
And using a verb as a name does break the semantics of usage.並使用一個動詞,作為一個名稱是否打破語義的使用。 What I want is a Log to which a I read from and write to.我想是一種日誌,以一個我看過和寫入。 Methods are where the action is方法是那裡的行動是
April 25th, 2005 at 6:08 pm 2005年4月25日在下午6時08分
@Kirk I couldn’t have said it better @柯克,我不能說這更好的