473,408 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Log design (serialization)

Hi,

I'm building a class library that uses the serial port to communicate with a
custom serial bus. Two of the classes I've built ("Packet" and "SerialPort")
uses an aggregated class "Log" to log their activity on a log file.

Now that it is working, I'd like to refactor it so it implements a better
design. What I want to do is instead of coupling a Log class to my Packet
and SerialPort classes, I want to be able to choose what type of log I want
to assign to my serial classes. The options I envision are: 1) A file log;
2) The console; 3) A remote log, that sends a (probably XML) text stream
over the net; 4) A null log, that does nothing when asked to log

I could create a base class for these logs, but then I couldn't use the
standard console (unless my derived class wraps it, which maybe it's not a
bad idea).

I'm a newcomer to the C# world and I only have a vague idea of how
serialization works. I've been investigating the help, but everywhere I look
they implement things using reflection, and I don't know if it is
justifiable in this case.

Do you have any design/implementation suggestions for this app?

Cheers

Padu
Mar 28 '06 #1
1 1433
Why not check out log4net? I supports all the loggers you seem to want
and you don't have to spend time rolling your own.
http://logging.apache.org/log4net/

Mar 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jack S | last post by:
Hi, I am currently working on an winforms client app. It has three main forms for user input. I am having trouble with a good design for persisting the user input. The user input will be used...
12
by: Nimmi Srivastav | last post by:
Are there any design patterns for object serialization/deserialization in C++? Where can I find information pertaining to them? Can someone post some real coding examples please? I have a need...
1
by: CrispinH | last post by:
I was after clarification of some of serialization issues. I think I know the answers, but I want to be sure. 1. In a serializable collection class is it mandatory (for serialization) to have...
2
by: Paul Cheetham | last post by:
Hi, I have moved an application from VS2003 to VS2005, and I am now unable to view most of my forms in the designer. The majority of the forms in my project are derived from class PACForm,...
4
by: alacrite | last post by:
I have a class that I want to turn its contents into csv file. I want to be able to set the value of the delimiter, the name of the file it gets saved to, the path of that file, and maybe a few...
3
by: --== Alain ==-- | last post by:
Hi, I've created a Form just for testing purposes. on this form i have a custom control that i created. Every time that i update my custom control (dll file), my test form displays the...
1
by: | last post by:
Hi. This is a a semi-newbie question about how to store arbitrary information about my apps such that I can code quickly, mimizing complexity and the number of things I have to hold in my brain. I...
0
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns: Visitor Introduction Polymorphism requires a class hierarchy where the interface to the hierarchy is in the base class. Virtual functions allow derived classes to override base...
2
by: teixeira1985 | last post by:
Hi , Due an unknown cause VS2005 started to show an error when i switch from code to design in windows forms projects. I repaired the installation but the same happens. The error is: One or...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.