编写自定义异常日志 [英] Write Custom Exception Logging

查看:87
本文介绍了编写自定义异常日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好;


在第一次面试之前我会找到工作,但是公司给我测试了一家小型企业,并且我已经在某些地方安装了该产品.项目简要如下:


为了能够与任何软件(可复用)集成,需要一个例外层.为了实现这些要求,请考虑以下各项,并使用设计模式和面向对象的原理并输入一个小型库.无需在内部编写函数.例如,当作者使用EmailPublisher''ısmtp组件时,只需使用关于该位置的真实解释就可以编写.


有三种异常类型.在异常"中没有优先级.每个Exception都有Class,必须全部属于自己.
-将针对此类型的异常进行UserLevelException记录
-完成CoreException-DB,文本,电子邮件和EventLog记录.
-CriticalUserLevelException-邮件将被抛出.


日志应用于发布者类
-EventLogPublisher
-EmailPublisher
-TextFilePublisher
-DBPublisher


不得用于配置xml.


例如,为方案指定的CriticalUserLevelException,在编写顺序不变的情况下将所有发布者都替换为替代者,并且导航方法将根据导航策略更改单一职责和开放-关闭"原则,以确保要编写Iterator类.


我的未来是有问题的. :sigh:预先非常感谢您的帮助.

Hi everyone;


I ll get a job before the first interview, but the company gave me to test a small business and I''ve had installed in some places. Project is briefly as follows:


To be able to be integrated with any software (reusab le) an exception layers are needed. To implement these requirements, taking into consideration the following items, using a design pattern and object oriented principles and enter a small library. No need to write functions inside. For example, while the author EmailPublisher''ı smtp component, rather than using a real explanation about the place is enough to write.


There are three kinds of exception types. Has no priority among Exceptions. Each Exception has Class, must be all their own.
- UserLevelException-logging will be made for this type exceptions
- CoreException-DB, Text, email and EventLog logging to be done.
- CriticalUserLevelException- mail will be thrown.


Logging should be used for the publisher classes
- EventLogPublisher
- EmailPublisher
- TextFilePublisher
- DBPublisher


must not be used for configuration xml.


For example CriticalUserLevelException given for the scenario all publishers be written as replacement in case of writing the order not change and navigation method would change the Single Responsibility and Open-Closed principle according to the navigation strategies to ensure the Iterator class to be written.


My future is in question. :sigh: Thank you in advance for your help very, very much

推荐答案

您的未来仍然有疑问.他们正在尝试找出*您*知道多少-而不是我们知道多少.如果您无法完成这项简单的任务,也许您应该考虑另外一项工作.
Your future is still in question. They''re trying to find out how much *you* know - NOT how much we know. If you can''t handle this simple task, maybe you should consider another line of work.


这篇关于编写自定义异常日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆