[英]Is UML Class Diagram of Zend_Log correct?
Background of question 问题的背景
Analysis of Zend_Log reveals following Class Diagram Zend_Log的分析揭示了以下类图
Zend_Log: Zend_Log进行:
Zend_Log_Writer_Abstract Zend_Log_Writer_Abstract
Questions 问题
Regards! 问候!
Zend_Log_Filter_Suppress
, Zend_Log_Filter_Message
, and Zend_Log_Filter_Priority
all implement the Zend_Log_Filter_Interface
interface. Zend_Log_Filter_Suppress
, Zend_Log_Filter_Message
和Zend_Log_Filter_Priority
都实现了Zend_Log_Filter_Interface
接口。 This is denoted using the empty arrow and dotted lines between them. 这用空箭头和它们之间的虚线表示。 The same is true for Zend_Log_Formatter_Interface
and the three classes depicted below it. Zend_Log_Formatter_Interface
和下面描述的三个类也是如此。
Yes, that's correct. 对,那是正确的。 Whether to use an association (-->) or composition here could be debated since two Zend_Log
instances could share a single Zend_Log_Writer_Db
instance. 由于两个Zend_Log
实例可以共享一个Zend_Log_Writer_Db
实例,因此可以讨论是否在此使用关联( - >)或组合。 As the writers and filters determine the overall behavior of the log, composition makes sense to me. 由于编写器和过滤器决定了日志的整体行为,因此组合对我来说很有意义。
Each log instance can write to multiple writers. 每个日志实例都可以写入多个编写器。 Messages are first filtered by the log itself, and any message that passes goes to every writer. 消息首先由日志本身过滤,任何传递的消息都会传递给每个编写器。 Each writer filters the incoming messages as well. 每个编写器也会过滤传入的消息。 This allows you to ignore all messages below the WARN
priority (at the log level) which get written to a file and further limit database logging to those at the FATAL
level. 这允许您忽略低于WARN
优先级(在日志级别)的所有消息,这些消息将写入文件并进一步限制数据库日志记录到FATAL
级别的数据库。 You could accomplish the same effect by dropping the log-level filter array, but it would require duplicating the filtering in each writer. 您可以通过删除日志级别的过滤器数组来实现相同的效果,但是它需要复制每个编写器中的过滤。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.