NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Common.Log.FileLog Class Reference
Inheritance diagram for Ntp.Common.Log.FileLog:
Collaboration diagram for Ntp.Common.Log.FileLog:

Public Member Functions

override void Close ()
 
void Dispose ()
 
- Public Member Functions inherited from Ntp.Common.Log.TextLog
override void Initialize ()
 
override void Resume ()
 
override void Suspend ()
 
override void WriteLine (string text, Severity severity)
 
override void WriteLine (Exception exception)
 
override void WriteLine (Exception exception, Severity severity)
 

Protected Member Functions

override TextWriter CreateWriter ()
 
- Protected Member Functions inherited from Ntp.Common.Log.TextLog
 TextLog (Severity threshold, string timeFormat)
 
- Protected Member Functions inherited from Ntp.Common.Log.LogBase
 LogBase (Severity threshold, bool isSysLog=false)
 

Package Functions

 FileLog (string file, Severity threshold, string timeFormat)
 

Private Member Functions

 ~FileLog ()
 
void Dispose (bool disposing)
 

Private Attributes

bool disposedValue
 
readonly string file
 
TextWriter writer
 

Additional Inherited Members

- Protected Attributes inherited from Ntp.Common.Log.TextLog
bool Closed
 
bool Initialized
 
readonly object Locker = new object()
 
- Properties inherited from Ntp.Common.Log.TextLog
bool ShowSeverity [get, set]
 
bool ShowTimeStamp [get, set]
 
- Properties inherited from Ntp.Common.Log.LogBase
bool IsSysLog [get]
 
Severity Threshold [get]
 

Detailed Description

Definition at line 28 of file FileLog.cs.

Constructor & Destructor Documentation

Ntp.Common.Log.FileLog.FileLog ( string  file,
Severity  threshold,
string  timeFormat 
)
inlinepackage

Definition at line 30 of file FileLog.cs.

31  : base(threshold, timeFormat)
32  {
33  this.file = file;
34  }
readonly string file
Definition: FileLog.cs:36
readonly string timeFormat
Definition: TextLog.cs:41
Ntp.Common.Log.FileLog.~FileLog ( )
inlineprivate

Definition at line 80 of file FileLog.cs.

81  {
82  Dispose(false);
83  }

Member Function Documentation

override void Ntp.Common.Log.FileLog.Close ( )
inlinevirtual

Implements Ntp.Common.Log.LogBase.

Definition at line 39 of file FileLog.cs.

40  {
41  lock (Locker)
42  {
43  if (writer != null)
44  {
45  writer.Close();
46  writer.Dispose();
47  writer = null;
48  }
49  Initialized = false;
50  Closed = true;
51  }
52  }
TextWriter writer
Definition: FileLog.cs:37
readonly object Locker
Definition: TextLog.cs:40
override TextWriter Ntp.Common.Log.FileLog.CreateWriter ( )
inlineprotectedvirtual

Implements Ntp.Common.Log.TextLog.

Definition at line 54 of file FileLog.cs.

55  {
56  writer = new StreamWriter(file, true, Encoding.ASCII);
57  return writer;
58  }
TextWriter writer
Definition: FileLog.cs:37
readonly string file
Definition: FileLog.cs:36
void Ntp.Common.Log.FileLog.Dispose ( bool  disposing)
inlineprivate

Definition at line 64 of file FileLog.cs.

65  {
66  if (disposedValue)
67  return;
68 
69  if (disposing && writer != null)
70  {
71  writer.Close();
72  writer.Dispose();
73  writer = null;
74  }
75 
76  disposedValue = true;
77  Closed = true;
78  }
TextWriter writer
Definition: FileLog.cs:37
void Ntp.Common.Log.FileLog.Dispose ( )
inline

Definition at line 85 of file FileLog.cs.

86  {
87  Dispose(true);
88  GC.SuppressFinalize(this);
89  }

Member Data Documentation

bool Ntp.Common.Log.FileLog.disposedValue
private

Definition at line 62 of file FileLog.cs.

readonly string Ntp.Common.Log.FileLog.file
private

Definition at line 36 of file FileLog.cs.

TextWriter Ntp.Common.Log.FileLog.writer
private

Definition at line 37 of file FileLog.cs.


The documentation for this class was generated from the following file: