Update buffered logging

* Update buffered logging
This commit is contained in:
abraunegg 2023-12-17 11:10:29 +11:00
parent 76d7f1129c
commit c399701ab3
6 changed files with 489 additions and 503 deletions

View file

@ -836,7 +836,7 @@ class ApplicationConfig {
string tempApplicationId = strip(c.front.dup);
if (tempApplicationId.empty) {
addLogEntry("Invalid value for key in config file: " ~ key);
addLogEntry("drive_id in config file cannot be empty - this is a fatal error and must be corrected", ["debug"]);
addLogEntry("drive_id in config file cannot be empty - this is a fatal error and must be corrected by removing this entry from your config file", ["debug"]);
exit(EXIT_FAILURE);
} else {
setValueString("drive_id", tempApplicationId);

View file

@ -152,66 +152,4 @@ void enableLogFileOutput(string configuredLogFilePath) {
void disableGUINotifications(bool userConfigDisableNotifications) {
logBuffer.sendGUINotification = userConfigDisableNotifications;
}
// OLD CODE ... TO REMOVE
// ####################################################################################################################
/**
void log(T...)(T args) {
// old log
writeln(args);
}
**/
void vlog(T...)(T args) {
// old verbose
//writeln("[VERBOSE] ", args);
}
void vdebug(T...)(T args) {
// old log
//writeln("[DEBUG] ", args);
}
void vdebugNewLine(T...)(T args) {
// old code
writeln("old vdebugNewLine");
}
/**
void error(T...)(T args) {
// old log
writeln("old error");
}
void logAndNotify(T...)(T args) {
// old log
writeln("old logAndNotify");
}
void errorAndNotify(T...)(T args) {
// old log
writeln("old errorAndNotify");
}
void fileOnly(T...)(T args) {
// old code
writeln("old fileOnly");
}
**/
}

View file

@ -1048,7 +1048,7 @@ void performStandardExitProcess(string scopeCaller = null) {
syncEngineInstance = null;
} else {
addLogEntry("Application exit", ["debug"]);
addLogEntry("---------------------------------------------------------------------------------------------------------------------------------------", ["logFileOnly"]);
addLogEntry("#######################################################################################################################################", ["logFileOnly"]);
// Sleep to allow any final logging output to be printed - this is needed as we are using buffered logging output
Thread.sleep(dur!("msecs")(500));
// Destroy the shared logging buffer

View file

@ -1531,7 +1531,7 @@ class OneDriveApi {
SysTime currentTime;
// Connectivity to Microsoft OneDrive was lost
addLogEntry("Internet connectivity to Microsoft OneDrive service has been lost");
addLogEntry("Internet connectivity to Microsoft OneDrive service has been lost .. re-trying in the background");
// what caused the initial curl exception?
if (canFind(errorMessage, "Couldn't connect to server on handle")) addLogEntry("Unable to connect to server - HTTPS access blocked?", ["debug"]);

File diff suppressed because it is too large Load diff

View file

@ -313,9 +313,9 @@ bool isValidName(string path) {
matched = false;
}
// Determine if the path is at the root level
// Determine if the path is at the root level, if yes, check that 'forms' is not the first folder
auto segments = pathSplitter(path).array;
if (segments.length <= 2 && itemName.toLower() == "forms") { // Convert to lower as OneDrive is not POSIX compliant
if (segments.length <= 2 && itemName.toLower() == "forms") { // Convert to lower as OneDrive is not POSIX compliant, easier to compare
matched = false;
}