Skip to content

Commit

Permalink
Update plugin logging
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Nov 6, 2024
1 parent b0426dc commit 94d5f9b
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Plugins/ArduinoOutput/ArduinoOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#ifndef __ARDUINOOUTPUT_H_F7BDA585__
#define __ARDUINOOUTPUT_H_F7BDA585__

#define PROCESSOR_NAME "Arduino Output"

#include <ProcessorHeaders.h>
#include <SerialLib.h>

#include <SerialLib.h>
#include "serial/ofArduino.h"

/**
Expand Down
3 changes: 2 additions & 1 deletion Plugins/BandpassFilter/BandpassFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
#ifndef __BANDPASSFILTER_H_CED428E__
#define __BANDPASSFILTER_H_CED428E__

#include <ProcessorHeaders.h>
#define PROCESSOR_NAME "Bandpass Filter"

#include <ProcessorHeaders.h>
#include <DspLib.h>

#define CHANNELS_PER_THREAD 32
Expand Down
2 changes: 1 addition & 1 deletion Plugins/ChannelMap/ChannelMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void ChannelMapSettings::fromXml (XmlElement* xml)
}
else
{
std::cout << channelParams->getTagName() << std::endl;
//std::cout << channelParams->getTagName() << std::endl;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Plugins/ChannelMap/ChannelMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#ifndef __CHANNELMAP_H_330E50E0__
#define __CHANNELMAP_H_330E50E0__

#define PROCESSOR_NAME "Channel Map"

#include <ProcessorHeaders.h>

/** Holds channel map settings for one data stream*/
Expand Down
2 changes: 2 additions & 0 deletions Plugins/CommonAvgRef/CommonAvgRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#ifndef CAR_H_INCLUDED
#define CAR_H_INCLUDED

#define PROCESSOR_NAME "Common Avg Ref"

#include <ProcessorHeaders.h>

/** Holds settings for one stream's CAR*/
Expand Down
59 changes: 59 additions & 0 deletions Plugins/Headers/Logging.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2024 Open Ephys
------------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PROCESSOR_NAME
#define PROCESSOR_NAME "Unknown"
#endif

#undef LOGA
#define LOGA(...) \
getOELogger().LOGFile("[" PROCESSOR_NAME "][action] ", __VA_ARGS__)

#undef LOGB
#define LOGB(...) \
getOELogger().LOGFile("[" PROCESSOR_NAME "][buffer] ", __VA_ARGS__)

#undef LOGC
#define LOGC(...) \
getOELogger().LOGConsole("[" PROCESSOR_NAME "] ", __VA_ARGS__)

#undef LOGD
#ifdef DEBUG
#define LOGD(...) \
getOELogger().LOGConsole("[" PROCESSOR_NAME "][debug] ", __VA_ARGS__)
#else
#define LOGD(...) \
getOELogger().LOGFile("[" PROCESSOR_NAME "][debug] ", __VA_ARGS__)
#endif

#undef LOGDD
#define LOGDD(...) \
getOELogger().LOGFile("[" PROCESSOR_NAME "][ddebug] ", __VA_ARGS__)

#undef LOGE
#define LOGE(...) \
getOELogger().LOGError("[" PROCESSOR_NAME "] ***ERROR*** ", __VA_ARGS__)

// Not applicable for plugins
#undef LOGF
#undef LOGG
1 change: 1 addition & 0 deletions Plugins/Headers/ProcessorHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Should be included in the source files which declare a processor class.
#include "../../Source/TestableExport.h"
#include "../../Source/Utils/BroadcastParser.h"
#include "DspLib.h"
#include "Logging.h"
2 changes: 2 additions & 0 deletions Plugins/PhaseDetector/PhaseDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#ifndef __PHASEDETECTOR_H_F411F29D__
#define __PHASEDETECTOR_H_F411F29D__

#define PROCESSOR_NAME "Phase Detector"

#include <ProcessorHeaders.h>

enum PhaseType
Expand Down
3 changes: 3 additions & 0 deletions Plugins/RecordControl/RecordControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#define __RECORDCONTROL_H_120DD434__

#include "RecordControlEditor.h"

#define PROCESSOR_NAME "Record Control"

#include <ProcessorHeaders.h>

/**
Expand Down
2 changes: 1 addition & 1 deletion Plugins/SpikeDetector/SpikeDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ bool SpikeDetector::stopAcquisition()
spikeChannel->reset();
}

//LOGC("SpikeDetector detected ", spikeCount, " spikes in ", totalCallbacks, " callbacks.");
LOGC("SpikeDetector detected ", spikeCount, " spikes in ", totalCallbacks, " callbacks.");

return true;
}
Expand Down
2 changes: 2 additions & 0 deletions Plugins/SpikeDetector/SpikeDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#ifndef __SPIKEDETECTOR_H_3F920F95__
#define __SPIKEDETECTOR_H_3F920F95__

#define PROCESSOR_NAME "Spike Detector"

#include <ProcessorHeaders.h>

class SpikeDetectorSettings
Expand Down

0 comments on commit 94d5f9b

Please sign in to comment.