By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

DotNetZip statusMessageTextWriter property use

maylortaylor
P: 72
I'm trying to get some Status messages exported to a log file that my program creates. The log file is created by the Class Logger and is called by using
Expand|Select|Wrap|Line Numbers
  1. mylogger.log(theMessage as string)
The DotNetZip status messages are called by using the code
Expand|Select|Wrap|Line Numbers
  1. zip.StatusMessageTextWriter
(Public Property StatusMessageTextWriter As System.IO.TextWriter). I can get these messages to print to my console by calling
Expand|Select|Wrap|Line Numbers
  1. zip.StatusMessageTextWriter = Console.Out
but I want these messages to also get printed to my log.

I tried doing this by
Expand|Select|Wrap|Line Numbers
  1. mylogger.log(zip.StatusMessagetextWriter.tostring)
but this just outputted "System.IO.TextWriter+SyncTextWriter" .

I am a bit new to coding so i'm unsure of how to get these two thing to work nicely with each other, any guidance would be appreciated greatly.
Feb 27 '13 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 622
I don't know anything about this program but do see a difference in the way you output to the console and the logger. I would suggest that first you get the message into a Python string, and then it should be easy to print or log.
Expand|Select|Wrap|Line Numbers
  1. ## = Console.out
  2. zip.StatusMessageTextWriter = Console.Out
  3. ## no "="
  4. mylogger.log(zip.StatusMessagetextWriter.tostring) 
Feb 27 '13 #2

maylortaylor
P: 72
@dwblas
You didn't change any of my code and i already explained that I couldn't do what you suggested. Also i'm using VB
Feb 27 '13 #3

Expert 100+
P: 622
Is VB Visual Basic? If so then this thread should be moved from the Python forum to the Visual Basic forum.
Feb 28 '13 #4

maylortaylor
P: 72
home > topics > visual basic .net > questions > dotnetzip statusmessagetextwriter property use .........according to the directory at the top...i'm in the right place.
Feb 28 '13 #5

Post your reply

Sign in to post your reply or Sign up for a free account.