25 |
{ |
{ |
26 |
if (!silent) |
if (!silent) |
27 |
logger.Debug.WriteLine(" Loading config for {0}...", this.ToString()); |
logger.Debug.WriteLine(" Loading config for {0}...", this.ToString()); |
28 |
init(); |
init(silent); |
29 |
if (!silent) |
if (!silent) |
30 |
logger.Debug.WriteLine(" Loaded config for {0}.", this.ToString()); |
logger.Debug.WriteLine(" Loaded config for {0}.", this.ToString()); |
31 |
} |
} |
32 |
private void init() |
private void init() { init(false); } |
33 |
|
private void init(bool silent) |
34 |
{ |
{ |
35 |
// loggerflags flags = logger.GetLoggingFlags(); |
// loggerflags flags = logger.GetLoggingFlags(); |
36 |
|
|
59 |
if (isSystem) |
if (isSystem) |
60 |
{ |
{ |
61 |
#if !DISALLOW_VERBOSE_LOGGING |
#if !DISALLOW_VERBOSE_LOGGING |
62 |
|
if(!silent) |
63 |
logger.VerboseDebug.WriteLine(" not adding process {0} because it is a system process", proc_name); |
logger.VerboseDebug.WriteLine(" not adding process {0} because it is a system process", proc_name); |
64 |
#endif |
#endif |
65 |
continue; |
continue; |
70 |
{ |
{ |
71 |
container = new ProcContainer(proc); |
container = new ProcContainer(proc); |
72 |
#if !DISALLOW_VERBOSE_LOGGING |
#if !DISALLOW_VERBOSE_LOGGING |
73 |
|
if(!silent) |
74 |
logger.VerboseDebug.WriteLine(" adding process {0} ", proc_name); |
logger.VerboseDebug.WriteLine(" adding process {0} ", proc_name); |
75 |
#endif |
#endif |
76 |
proc_list.Add(container); |
proc_list.Add(container); |
80 |
catch (Exception ex) |
catch (Exception ex) |
81 |
{ |
{ |
82 |
//throw; |
//throw; |
83 |
|
if(!silent) |
84 |
logger.VerboseError.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString()); |
logger.VerboseError.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString()); |
85 |
//continue; |
//continue; |
86 |
} |
} |
93 |
if (!((uint)ex.ErrorCode == 0x80004005)) |
if (!((uint)ex.ErrorCode == 0x80004005)) |
94 |
{ |
{ |
95 |
#if !DISALLOW_VERBOSE_LOGGING |
#if !DISALLOW_VERBOSE_LOGGING |
96 |
|
if(!silent) |
97 |
logger.VerboseError.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString()); |
logger.VerboseError.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString()); |
98 |
#endif |
#endif |
99 |
} |
} |
102 |
#if !DISALLOW_VERBOSE_LOGGING |
#if !DISALLOW_VERBOSE_LOGGING |
103 |
catch (Exception ex) |
catch (Exception ex) |
104 |
{ |
{ |
105 |
|
if(!silent) |
106 |
logger.VerboseError.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString()); |
logger.VerboseError.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString()); |
107 |
//continue; |
//continue; |
108 |
} |
} |