Skip to content

Commit 1e515e0

Browse files
committed
STDERR: Show messages from infologger_syslog file
1 parent fe3782a commit 1e515e0

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,19 @@ struct fileMon {
4545
bool stopped = false;
4646

4747
fileMon(const std::string& path, const std::string& filename);
48+
fileMon(const std::string& filename, std::ifstream&& f);
4849
};
4950

50-
fileMon::fileMon(const std::string& path, const std::string& filename)
51+
fileMon::fileMon(const std::string& path, const std::string& filename) : name(filename)
5152
{
5253
printf("Monitoring file %s\n", filename.c_str());
53-
name = filename;
5454
file.open(path + "/" + filename, std::ifstream::in);
5555
}
5656

57+
fileMon::fileMon(const std::string& filename, std::ifstream&& f) : file(std::move(f)), name(filename)
58+
{
59+
}
60+
5761
class EPNMonitor
5862
{
5963
public:
@@ -130,6 +134,15 @@ void EPNMonitor::thread()
130134
{
131135
printf("EPN stderr Monitor active\n");
132136

137+
try {
138+
std::string syslogfile = "/var/log/infologger_syslog";
139+
std::ifstream file;
140+
file.open(syslogfile, std::ifstream::in);
141+
file.seekg(0, file.end);
142+
mFiles.emplace(std::piecewise_construct, std::forward_as_tuple(syslogfile), std::forward_as_tuple(std::string("SYSLOG"), std::move(file)));
143+
} catch (...) {
144+
}
145+
133146
int fd;
134147
int wd;
135148
static constexpr size_t BUFFER_SIZE = 64 * 1024;

0 commit comments

Comments
 (0)