NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Common.Log.LogExtensions Class Reference

Static Package Functions

static void ClusterError (this LogBase log, Exception e)
 
static void ClusterNodeActive (this LogBase log, IRequest request)
 
static void ClusterNodeAlive (this LogBase log, IRequest request)
 
static void ClusterNodeDead (this LogBase log, IRequest request)
 
static void ClusterNodeError (this LogBase log, IRequest request, Exception e)
 
static void ClusterStart (this LogBase log)
 
static void HeartbeatStarted (this LogBase log, int interval)
 
static void HeartbeatUptime (this LogBase log, string time)
 
static void JobError (this LogBase log, Job job, Exception e)
 
static void JobExecutionStatus (this LogBase log, Job job, bool error)
 
static void ReceivedSignal (this LogBase log, string signal)
 
static void SchedulerAbort (this LogBase log, Thread thread)
 
static void SchedulerBehind (this LogBase log)
 
static void SchedulerError (this LogBase log, string name, Exception e)
 
static void SchedulerFinished (this LogBase log)
 
static void SchedulerJobAdded (this LogBase log, JobDescription description, Job job)
 
static void SchedulerJobExecuting (this LogBase log, ScheduledJob next)
 
static void SchedulerJobStatus (this LogBase log, ScheduledJob scheduledJob)
 
static void SchedulerStart (this LogBase log, int count)
 
static void SchedulerWaiting (this LogBase log, int count)
 
static void ShellCommandError (this LogBase log, string message, string error)
 
static void ShellCommandExecuting (this LogBase log, string command, string arguments)
 
static void SignalClosing (this LogBase log)
 
static void SignalError (this LogBase log, Exception e)
 
static void SignalHandlerError (this LogBase log, Exception e)
 
static void SignalInterProcError (this LogBase log)
 
static void SignalRefreshing (this LogBase log)
 
static void SignalReloading (this LogBase log)
 
static void UnexpectedSignal (this LogBase log)
 
static void UnknownSignal (this LogBase log, string signal)
 

Detailed Description

Definition at line 28 of file LogExtensions.cs.

Member Function Documentation

static void Ntp.Common.Log.LogExtensions.ClusterError ( this LogBase  log,
Exception  e 
)
inlinestaticpackage

Definition at line 30 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

31  {
32  log.WriteLine(
33  "Error in scheduler module. Aborting.",
34  Severity.Error);
35 
36  log.WriteLine(e);
37  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ClusterNodeActive ( this LogBase  log,
IRequest  request 
)
inlinestaticpackage

Definition at line 39 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

40  {
41  log.WriteLine(
42  $"Cluster node {request} is active.",
43  Severity.Notice);
44  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ClusterNodeAlive ( this LogBase  log,
IRequest  request 
)
inlinestaticpackage

Definition at line 46 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

47  {
48  log.WriteLine(
49  $"Cluster node {request} is alive.",
50  Severity.Notice);
51  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ClusterNodeDead ( this LogBase  log,
IRequest  request 
)
inlinestaticpackage

Definition at line 53 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

54  {
55  log.WriteLine(
56  $"Cluster node {request} is dead.",
57  Severity.Notice);
58  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ClusterNodeError ( this LogBase  log,
IRequest  request,
Exception  e 
)
inlinestaticpackage

Definition at line 60 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

61  {
62  log.WriteLine(
63  $"Error while contacting cluster node {request}.",
64  Severity.Warn);
65 
66  log.WriteLine(e);
67  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ClusterStart ( this LogBase  log)
inlinestaticpackage

Definition at line 69 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

70  {
71  log.WriteLine(
72  "Starting cluster module.",
73  Severity.Info);
74  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.HeartbeatStarted ( this LogBase  log,
int  interval 
)
inlinestaticpackage

Definition at line 76 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

77  {
78  log.WriteLine(
79  $"Heartbeat started with {interval} minutes interval.",
80  Severity.Notice);
81  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.HeartbeatUptime ( this LogBase  log,
string  time 
)
inlinestaticpackage

Definition at line 83 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

84  {
85  log.WriteLine(
86  $"Heartbeat: Uptime is {time}.",
87  Severity.Notice);
88  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.JobError ( this LogBase  log,
Job  job,
Exception  e 
)
inlinestaticpackage

Definition at line 90 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

91  {
92  log.WriteLine(
93  $"Error while executing {job}.",
94  Severity.Error);
95 
96  log.WriteLine(e);
97  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.JobExecutionStatus ( this LogBase  log,
Job  job,
bool  error 
)
inlinestaticpackage

Definition at line 99 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

100  {
101  log.WriteLine(
102  error
103  ? $"{job} failed."
104  : $"{job} is done.",
105  Severity.Debug);
106  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ReceivedSignal ( this LogBase  log,
string  signal 
)
inlinestaticpackage

Definition at line 108 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

109  {
110  log.WriteLine(
111  $"Received signal {signal}",
112  Severity.Debug);
113  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerAbort ( this LogBase  log,
Thread  thread 
)
inlinestaticpackage

Definition at line 115 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

116  {
117  log.WriteLine(
118  $"Aborting thread {thread.Name}.",
119  Severity.Warn);
120  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerBehind ( this LogBase  log)
inlinestaticpackage

Definition at line 122 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

123  {
124  log.WriteLine(
125  "Behind schedule. Trying to catch up.",
126  Severity.Info);
127  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerError ( this LogBase  log,
string  name,
Exception  e 
)
inlinestaticpackage

Definition at line 129 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

130  {
131  log.WriteLine(
132  $"Unexpected error in thread {name}.",
133  Severity.Error);
134 
135  log.WriteLine(e);
136  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerFinished ( this LogBase  log)
inlinestaticpackage

Definition at line 138 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

139  {
140  log.WriteLine(
141  "All threads finished.",
142  Severity.Notice);
143  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerJobAdded ( this LogBase  log,
JobDescription  description,
Job  job 
)
inlinestaticpackage

Definition at line 145 of file LogExtensions.cs.

References Ntp.Common.Process.Job.Description, Ntp.Common.Process.JobScheduleDescription.FixedRun, Ntp.Common.Process.JobScheduleDescription.Frequency, Ntp.Common.Process.JobDescription.JobType, Ntp.Common.Process.JobDescription.Name, Ntp.Common.Process.Job.Schedule, and Ntp.Common.Log.LogBase.WriteLine().

146  {
147  var type = job.Description.JobType;
148  var freq = job.Schedule.Frequency;
149 
150  var desc = string.IsNullOrWhiteSpace(job.Description.Name)
151  ? string.Empty
152  : " " + description.Name;
153 
154  var fix = job.Schedule.FixedRun
155  ? "fixed "
156  : string.Empty;
157 
158  log.WriteLine(
159  freq != 0
160  ? $"{type} job{desc} added to scheduler with {fix}{freq} minutes run interval."
161  : $"{type} job{desc} added to scheduler for a single run.",
162  Severity.Info);
163  }
JobScheduleDescription Schedule
Gets the schedule.
Definition: Job.cs:65
abstract string JobType
Gets the type of the job as text.
int Frequency
Gets the schedule frequency in minutes.
bool FixedRun
Gets a value indicating whether this JobScheduleDescription has a fixed schedule frequency, eg. cannot be moved.
JobDescription Description
Gets the description.
Definition: Job.cs:71

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerJobExecuting ( this LogBase  log,
ScheduledJob  next 
)
inlinestaticpackage

Definition at line 165 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

166  {
167  log.WriteLine(
168  $"{next.Job} started.",
169  Severity.Info);
170  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerJobStatus ( this LogBase  log,
ScheduledJob  scheduledJob 
)
inlinestaticpackage

Definition at line 172 of file LogExtensions.cs.

References Ntp.Common.Process.ScheduledJob.Job, Ntp.Common.Process.Job.RunCount, and Ntp.Common.Log.LogBase.WriteLine().

173  {
174  string re = scheduledJob.Job.RunCount == 0 ? string.Empty : "re";
175 
176  log.WriteLine(
177  $"{scheduledJob.Job} {re}scheduled to run {scheduledJob.Run.ToString("HH:mm:ss")}",
178  Severity.Debug);
179  }
Job Job
Gets the job to execute.
Definition: ScheduledJob.cs:46
int RunCount
Gets the number of times this Job have been executed.
Definition: Job.cs:101

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerStart ( this LogBase  log,
int  count 
)
inlinestaticpackage

Definition at line 181 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

182  {
183  log.WriteLine(
184  $"Starting scheduler with {count} jobs.",
185  Severity.Info);
186  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SchedulerWaiting ( this LogBase  log,
int  count 
)
inlinestaticpackage

Definition at line 188 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

189  {
190  log.WriteLine(
191  $"Waiting for {count} threads to finish.",
192  Severity.Notice);
193  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ShellCommandError ( this LogBase  log,
string  message,
string  error 
)
inlinestaticpackage

Definition at line 195 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

196  {
197  log.WriteLine(
198  $"{message} {error}",
199  Severity.Warn);
200  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.ShellCommandExecuting ( this LogBase  log,
string  command,
string  arguments 
)
inlinestaticpackage

Definition at line 202 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

203  {
204  log.WriteLine(
205  $"Executing: {command} {arguments}",
206  Severity.Debug);
207  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SignalClosing ( this LogBase  log)
inlinestaticpackage

Definition at line 209 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

210  {
211  log.WriteLine(
212  "Closing down.",
213  Severity.Notice);
214  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SignalError ( this LogBase  log,
Exception  e 
)
inlinestaticpackage

Definition at line 216 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

217  {
218  log.WriteLine(
219  "Unrecoverable error in UnixSignal.WaitAny()",
220  Severity.Error);
221 
222  log.WriteLine(e);
223  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SignalHandlerError ( this LogBase  log,
Exception  e 
)
inlinestaticpackage

Definition at line 225 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

226  {
227  log.WriteLine(
228  "Unrecoverable error in SignalHandler: {e.Message}",
229  Severity.Error);
230 
231  log.WriteLine(e);
232  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SignalInterProcError ( this LogBase  log)
inlinestaticpackage

Definition at line 234 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

235  {
236  log.WriteLine(
237  "Error in inter-process communication.",
238  Severity.Warn);
239  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SignalRefreshing ( this LogBase  log)
inlinestaticpackage

Definition at line 241 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

242  {
243  log.WriteLine(
244  "Refreshing logs.",
245  Severity.Notice);
246  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.SignalReloading ( this LogBase  log)
inlinestaticpackage

Definition at line 248 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

249  {
250  log.WriteLine(
251  "Reloading configuration.",
252  Severity.Notice);
253  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.UnexpectedSignal ( this LogBase  log)
inlinestaticpackage

Definition at line 255 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

256  {
257  log.WriteLine(
258  "Unexpected inter-process signal.",
259  Severity.Warn);
260  }

Here is the call graph for this function:

static void Ntp.Common.Log.LogExtensions.UnknownSignal ( this LogBase  log,
string  signal 
)
inlinestaticpackage

Definition at line 262 of file LogExtensions.cs.

References Ntp.Common.Log.LogBase.WriteLine().

263  {
264  log.WriteLine(
265  $"Received unknown signal {signal}",
266  Severity.Warn);
267  }

Here is the call graph for this function:


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