Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel <manuel@duet3d.com>2020-10-29 18:53:41 +0300
committerGitHub <noreply@github.com>2020-10-29 18:53:41 +0300
commit75fef214f21e675394e53798c699ace6ee6df521 (patch)
treeaca093c1ca75ab8fed17aa25dbeee5351c97713f /src/RepRap.cpp
parentc5af8416b82372a1e79b00b4d26110117ae2a35b (diff)
Extended logging (#446)
* Extend log levels from only 0 and 1 to 0 to 3 Add log level to the object model as state.logLevel Use the two top bits in MessageType to represent log levels Add L parameter to M118 to have the message logged at the given level Add logging for G10, M291, M292 Add current version to start of logging Make all non-flagged messages being part of log level DEBUG * Apply requested changes * Fix compiler error
Diffstat (limited to 'src/RepRap.cpp')
-rw-r--r--src/RepRap.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/RepRap.cpp b/src/RepRap.cpp
index 705ff28a..1d7b6cf2 100644
--- a/src/RepRap.cpp
+++ b/src/RepRap.cpp
@@ -317,6 +317,7 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] =
#else
{ "logFile", OBJECT_MODEL_FUNC_NOSELF(nullptr), ObjectModelEntryFlags::none },
#endif
+ { "logLevel", OBJECT_MODEL_FUNC(self->platform->GetLogLevel()), ObjectModelEntryFlags::none },
{ "machineMode", OBJECT_MODEL_FUNC(self->gCodes->GetMachineModeString()), ObjectModelEntryFlags::none },
{ "messageBox", OBJECT_MODEL_FUNC_IF(self->mbox.active, self, 5), ObjectModelEntryFlags::none },
{ "msUpTime", OBJECT_MODEL_FUNC_NOSELF((int32_t)(context.GetStartMillis() % 1000u)), ObjectModelEntryFlags::live },
@@ -380,7 +381,7 @@ constexpr uint8_t RepRap::objectModelTableDescriptor[] =
0, // directories
#endif
25, // limits
- 15 + HAS_VOLTAGE_MONITOR + SUPPORT_LASER, // state
+ 16 + HAS_VOLTAGE_MONITOR + SUPPORT_LASER, // state
2, // state.beep
6, // state.messageBox
11 + HAS_NETWORKING + SUPPORT_SCANNER + 2 * HAS_MASS_STORAGE // seqs
@@ -2414,6 +2415,7 @@ void RepRap::SetMessage(const char *msg) noexcept
{
platform->SendPanelDueMessage(0, msg);
}
+ platform->Message(MessageType::LogInfo, msg);
}
// Display a message box on the web interface
@@ -2711,7 +2713,7 @@ void RepRap::UpdateFirmware() noexcept
FileStore * const iapFile = platform->OpenFile(DEFAULT_SYS_DIR, IAP_UPDATE_FILE, OpenMode::read);
if (iapFile == nullptr)
{
- platform->MessageF(FirmwareUpdateMessage, "IAP file '" IAP_UPDATE_FILE "' not found\n");
+ platform->Message(FirmwareUpdateMessage, "IAP file '" IAP_UPDATE_FILE "' not found\n");
return;
}