| RE: [aus-dotnet] Whidbey Beta2 and the "Go Live" |
- From: Mina Casiou
- Subject: RE: [aus-dotnet] Whidbey Beta2 and the "Go Live"
- Date: Thu, 02 Dec 2004 12:31:12 +1100
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sean,
Thanks for the idea etc.
Serialize is not the only type of processing I do on logging a message etc.
Think about it. Basically any string operation you do, constants and all,
can be done there.
The point it to make the calling logging code simpler, not more complex and
to have less of it.
I don't know of a nice generic way to do what you've shown. Again, the goal
is simple client code. ==> Simpler than what it currently is.
I'm open to any ideas.
Thanks
Cheers
Minas Casiou
Information Systems Architect, Senior Consultant
CSC Australia – Financial Services - Enterprise Business Solutions
26 Talavera Road
Macquarie Park NSW
2113 Australia
Ph: (02) 9034 3338
Mob: 0412 343 069
email: mcasiou@xxxxxxxxxx
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------------------
|---------+--------------------------->
| | Sean Malloy |
| | <Sean@xxxxxxxxxx|
| | m.au> |
| | Sent by: |
| | dotnet-owner@sta|
| | nski.com |
| | |
| | |
| | 02/12/2004 12:09|
| | PM |
| | Please respond |
| | to dotnet |
| | |
|---------+--------------------------->
>-------------------------------------------------------------------------------------------------------------------------------|
| |
| To: "'dotnet@xxxxxxxxxxx'" <dotnet@xxxxxxxxxxx> |
| cc: |
| Subject: RE: [aus-dotnet] Whidbey Beta2 and the "Go Live" |
>-------------------------------------------------------------------------------------------------------------------------------|
> I'd like to submit a feature request if allowed! Not sure of the exact
> place to ask for this, but hopefully you'll let us know.
> It's probably too late to ask for this, and it'll probably
> require a change
> to the CLR (read as - so it'll probably never happen!)...
> Anyway, here goes...
>
> Problem: Logging/Instrumentation etc...
> When attempting to write performance conscious logging code,
> for example,
> using the Logging App. Block and the EIF, the 1 liner's etc.
Rather than having unecessarily complex features tacked-on to the
language/runtime, can't you just create a few new objects?
interface IMessageProvider
{
string Message { get; }
}
// implemented as a struct because its only a temp obj and we're not
keeping
references to it. Keep it on the stack.
struct SerializableMessageProvider : IMessageProvider
{
private SerializableObject obj;
public SerializableMessageProvider(SerializableObject obj) { this.obj =
obj; }
public string Message { get { return obj.SerializeToXML(); } }
}
public function Raise (myEventSource as EventSource, eventPublishLogLevel
as Integer, msgToLog as IMessageProvider)
If (eventPublishLogLevel > applicationLogLevel) And
EventSource.Application.IsEnabledForType(GetType(TraceMessageEvent)) Then
'do the actual logging work...
actualLog(myEventSource, eventPublishLogLevel,
msgToLog.Message)
End If
end function
Well. thats what I'd do.. Then just create implementations for various
objects you need to "lazily" invoke messages on
TraceMessageEvent.Raise(source, level, new
SerializableMessageProvider(obj)); // SerializeToXML() isn't calle dunless
its actually needed.
Sorry about the hodge podge mizing of VB and C#, I don't know all the
syntax
for VB. You could also think up better names too.
_________________
You are a part of the Australian "dotnet" mailing list.
To unsubscribe send "unsubscribe dotnet" or to re-subscribe send "subscribe
dotnet Your Name" in the body of the email to: imailsrv@xxxxxxxxxxx
List managed by: http://www.stanski.com
(Click here for more information on the aus-dotnet mailling list)
- Prev by Date: RE: [aus-dotnet] Whidbey Beta2 and the "Go Live"
- Next by Date: RE: [aus-dotnet] Whidbey Beta2 and the "Go Live"
- Previous by thread: RE: [aus-dotnet] Whidbey Beta2 and the "Go Live"
- Next by thread: RE: [aus-dotnet] Whidbey Beta2 and the "Go Live"
- Index(es):
