redirect snippet cost console
let's contend i'm operative small batch-processing console app vb.net. i wish means structure app this:
sub workermethod()
'do work
trace.writeline("work progress")
'do some-more work
trace.writeline("another swell update")
'...
end sub
sub main()
'do any setup, endorse user wants continue whatever
workermethod()
end sub
note i'm controlling trace
rather console
output. since workman slight competence called elsewhere, even live opposite assembly, i wish means insert opposite snippet listeners it. i bond console trace?
i already defining rudimentary category (shown below) adding an instance trace's listeners collection, nonetheless i'm wondering there's some-more supposed built proceed accomplish this:
public category consoletrace
inherits diagnostics.tracelistener
open overloads overrides servant write(byval summary string)
console.write(message)
finish sub
open overloads overrides servant writeline(byval summary string)
console.writeline(message)
finish sub
end class
Comments
Post a Comment