aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Framework.Console/ConsoleBase.cs
diff options
context:
space:
mode:
authorMW2007-04-26 17:50:25 +0000
committerMW2007-04-26 17:50:25 +0000
commit14a4ff308190af61783f1c4c686bcfc3dfa07a4f (patch)
tree70e9c899bfcd1e04399771ff25a89bebdf866867 /OpenSim.Framework.Console/ConsoleBase.cs
parentAt last: avatar-template.dat is no more (diff)
downloadopensim-SC_OLD-14a4ff308190af61783f1c4c686bcfc3dfa07a4f.zip
opensim-SC_OLD-14a4ff308190af61783f1c4c686bcfc3dfa07a4f.tar.gz
opensim-SC_OLD-14a4ff308190af61783f1c4c686bcfc3dfa07a4f.tar.bz2
opensim-SC_OLD-14a4ff308190af61783f1c4c686bcfc3dfa07a4f.tar.xz
added just what opensim needs...yet another command line option: -noverbose . cut down on the system console output (should really be stopping it all but not all output is going through OpenSim.Framework.Console)
Diffstat (limited to 'OpenSim.Framework.Console/ConsoleBase.cs')
-rw-r--r--OpenSim.Framework.Console/ConsoleBase.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/OpenSim.Framework.Console/ConsoleBase.cs b/OpenSim.Framework.Console/ConsoleBase.cs
index 89c751f..39d2b28 100644
--- a/OpenSim.Framework.Console/ConsoleBase.cs
+++ b/OpenSim.Framework.Console/ConsoleBase.cs
@@ -8,6 +8,7 @@ namespace OpenSim.Framework.Console
8 StreamWriter Log; 8 StreamWriter Log;
9 public conscmd_callback cmdparser; 9 public conscmd_callback cmdparser;
10 public string componentname; 10 public string componentname;
11 private bool disableOutput;
11 12
12 // STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!! 13 // STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!!
13 // constype - the type of console to use (see enum ConsoleType) 14 // constype - the type of console to use (see enum ConsoleType)
@@ -21,11 +22,11 @@ namespace OpenSim.Framework.Console
21 // componentname - which component of the OGS system? (user, asset etc) 22 // componentname - which component of the OGS system? (user, asset etc)
22 // cmdparser - a reference to a conscmd_callback object 23 // cmdparser - a reference to a conscmd_callback object
23 24
24 public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser) 25 public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool disableSystemConsole )
25 { 26 {
26 this.componentname = componentname; 27 this.componentname = componentname;
27 this.cmdparser = cmdparser; 28 this.cmdparser = cmdparser;
28 29 this.disableOutput = disableSystemConsole;
29 System.Console.WriteLine("ServerConsole.cs - creating new local console"); 30 System.Console.WriteLine("ServerConsole.cs - creating new local console");
30 System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); 31 System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
31 Log = File.AppendText(LogFile); 32 Log = File.AppendText(LogFile);
@@ -42,14 +43,20 @@ namespace OpenSim.Framework.Console
42 public void Write(string format, params object[] args) 43 public void Write(string format, params object[] args)
43 { 44 {
44 Log.Write(format, args); 45 Log.Write(format, args);
46 if(!disableOutput)
47 {
45 System.Console.Write(format, args); 48 System.Console.Write(format, args);
49 }
46 return; 50 return;
47 } 51 }
48 52
49 public void WriteLine(string format, params object[] args) 53 public void WriteLine(string format, params object[] args)
50 { 54 {
51 Log.WriteLine(format, args); 55 Log.WriteLine(format, args);
56 if(!disableOutput)
57 {
52 System.Console.WriteLine(format, args); 58 System.Console.WriteLine(format, args);
59 }
53 return; 60 return;
54 } 61 }
55 62