Black Box
BBTasker
BBSensorsErrorLog
BBSensorErrorLog.cs
Go to the documentation of this file.
1
/*
2
* FILE : BBSensorErrorLogs.cs
3
* PROJECT : Black Box
4
* PROGRAMMER : BRIAN HINDS
5
* FIRST VERSION : 1.0.0.0
6
* DATE : March 20, 2019
7
* DESCRIPTION : This file manages the data logging of all errors.
8
*/
9
10
using
System;
11
using
System.IO;
12
13
namespace
BBSensorsErrorLog
14
{
15
public
class
BBSensorErrorLog
16
{
17
private
static
readonly
string
dataPath
=
@"BBEL\sensorErrorLog.txt"
;
18
23
public
static
void
SaveErrorData
(
string
error)
24
{
25
if
(!File.Exists(
dataPath
))
26
{
27
File.WriteAllText(
dataPath
, error + DateTime.Now.ToString(
"HH:mm:ss"
) +
","
+ DateTime.Now.ToString(
"yyyy-MM-dd"
) + Environment.NewLine);
28
}
29
30
File.AppendAllText(
dataPath
, error + DateTime.Now.ToString(
"HH:mm:ss"
) +
","
+ DateTime.Now.ToString(
"yyyy-MM-dd"
) + Environment.NewLine);
31
}
32
}
33
}
BBSensorsErrorLog.BBSensorErrorLog
Definition:
BBSensorErrorLog.cs:15
BBSensorsErrorLog.BBSensorErrorLog.dataPath
static readonly string dataPath
Definition:
BBSensorErrorLog.cs:17
BBSensorsErrorLog.BBSensorErrorLog.SaveErrorData
static void SaveErrorData(string error)
Log all the error that occurs in the program
Definition:
BBSensorErrorLog.cs:23
BBSensorsErrorLog
Definition:
BBSensorErrorLog.cs:13
Generated by
1.8.15