Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Proxy Logging setting #204

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 4 comments
Open

Add Proxy Logging setting #204

GoogleCodeExporter opened this issue Mar 15, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

Hi,

you can add proxy.Logging setting - to easily turn on/off proxy logging.

protected void WriteDebug(string msg)
{
    if (Logging)
    {
        try
        {
            lock (debugLock)
            {
                System.IO.StreamWriter sw = new
System.IO.StreamWriter(System.IO.Path.Combine(Application.StartupPath,
"proxy_log.txt"), true);
                sw.WriteLine(System.DateTime.Now.ToShortDateString() + " " +
System.DateTime.Now.ToLongTimeString() + " " + msg + "\nLast received
packet types: " + GetLastReceivedPacketTypesString());
                sw.Close();
            }
        }
        catch
        {
        }
    }
    else
    {
        return;
    }
}

And somewhere in ProxyBase.cs

public bool Logging = true;

So you can easily turn on\off logs.
client.IO.Proxy.Logging = false;

Muttley

Original issue reported on code.google.com by muttd...@gmail.com on 26 Apr 2010 at 1:11

@GoogleCodeExporter
Copy link
Author

Personally, I see this as an unneeded feature. However, I'm going to leave this 
open if another developer happens to think otherwise.

Original comment by joebingham07@gmail.com on 29 Sep 2010 at 4:40

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

It would take about 2 minutes to implement and test, I don't see why not. I'll 
take care of it.

Original comment by ian320 on 29 Sep 2010 at 5:00

  • Changed state: Accepted
  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

For some reason, when I reviewed this last night, I thought it only logged the 
last packet upon debug. I now understand it would log all packets, so I believe 
it would be a good implementation. I don't, however, think it should be limited 
to just the proxy. Which I'm sure you already had that in mind.

Original comment by joebingham07@gmail.com on 29 Sep 2010 at 7:42

@GoogleCodeExporter
Copy link
Author

We already log the last N packets (5 or 10 I think) and output them whenever 
there is an error. This request is a bit different; asking us to have an option 
to disable logging entirely.

Original comment by ian320 on 19 Oct 2010 at 8:54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant