diff --git a/source/authentication/udaClientSSL.cpp b/source/authentication/udaClientSSL.cpp index 3023851c..891da004 100644 --- a/source/authentication/udaClientSSL.cpp +++ b/source/authentication/udaClientSSL.cpp @@ -15,6 +15,7 @@ using namespace uda::client_server; using namespace uda::client; using namespace uda::authentication; +using namespace uda::logging; static bool g_sslDisabled = true; // Default state is not SSL authentication static int g_sslProtocol = 0; // The default server host name has the SSL protocol name prefix or diff --git a/source/authentication/udaServerSSL.cpp b/source/authentication/udaServerSSL.cpp index 38421b7d..6fbed8fb 100644 --- a/source/authentication/udaServerSSL.cpp +++ b/source/authentication/udaServerSSL.cpp @@ -21,6 +21,7 @@ using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; /* Note on initialisation: diff --git a/source/c_api/accAPI.cpp b/source/c_api/accAPI.cpp index 7658f461..8f103b5f 100644 --- a/source/c_api/accAPI.cpp +++ b/source/c_api/accAPI.cpp @@ -33,6 +33,7 @@ using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; USERDEFINEDTYPE* udaGetUserDefinedType(int handle); USERDEFINEDTYPELIST* udaGetUserDefinedTypeList(int handle); diff --git a/source/c_api/clientAPI.cpp b/source/c_api/clientAPI.cpp index 44dd9a3a..be3082e9 100644 --- a/source/c_api/clientAPI.cpp +++ b/source/c_api/clientAPI.cpp @@ -16,6 +16,7 @@ using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; int udaClientAPI(const char* file, const char* signal, int pass, int exp_number) { diff --git a/source/c_api/clientMDS.cpp b/source/c_api/clientMDS.cpp index fc663177..1d6381be 100644 --- a/source/c_api/clientMDS.cpp +++ b/source/c_api/clientMDS.cpp @@ -6,6 +6,7 @@ using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; /** * Reads the Requested Data diff --git a/source/c_api/udaGetAPI.cpp b/source/c_api/udaGetAPI.cpp index dafaf219..cd19cd70 100644 --- a/source/c_api/udaGetAPI.cpp +++ b/source/c_api/udaGetAPI.cpp @@ -36,6 +36,7 @@ using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; typedef struct { int id; // Thread identifier assigned by the application diff --git a/source/c_api/udaPutAPI.cpp b/source/c_api/udaPutAPI.cpp index 0bc85c0b..389a703a 100644 --- a/source/c_api/udaPutAPI.cpp +++ b/source/c_api/udaPutAPI.cpp @@ -32,6 +32,7 @@ using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; int udaPutListAPI(const char* putInstruction, PUTDATA_BLOCK_LIST* inPutDataBlockList) { diff --git a/source/client/clientXDRStream.cpp b/source/client/clientXDRStream.cpp index c12b6d6b..50d81319 100644 --- a/source/client/clientXDRStream.cpp +++ b/source/client/clientXDRStream.cpp @@ -14,6 +14,8 @@ using namespace uda::authentication; #endif +using namespace uda::logging; + std::pair uda::client::clientCreateXDRStream() { static XDR client_input = {}; diff --git a/source/client/closedown.cpp b/source/client/closedown.cpp index e18f5e97..67661f76 100644 --- a/source/client/closedown.cpp +++ b/source/client/closedown.cpp @@ -28,6 +28,7 @@ using namespace uda::authentication; #endif using namespace uda::client; +using namespace uda::logging; int uda::client::closedown(ClosedownType type, uda::client_server::SOCKETLIST* socket_list, XDR* client_input, XDR* client_output, bool* reopen_logs) diff --git a/source/client/connection.cpp b/source/client/connection.cpp index efae65e5..927d683b 100644 --- a/source/client/connection.cpp +++ b/source/client/connection.cpp @@ -64,6 +64,7 @@ using namespace uda::client_server; using namespace uda::client; using namespace uda::authentication; +using namespace uda::logging; static int client_socket = -1; static SOCKETLIST client_socketlist; // List of open sockets diff --git a/source/client/getEnvironment.cpp b/source/client/getEnvironment.cpp index 6bc3d0d4..3ceae8a0 100644 --- a/source/client/getEnvironment.cpp +++ b/source/client/getEnvironment.cpp @@ -5,6 +5,8 @@ #include "logging/logging.h" +using namespace uda::logging; + bool env_host = true; // User can change these before startup so flag to the getEnvironment function bool env_port = true; diff --git a/source/client/startup.cpp b/source/client/startup.cpp index 8e254553..2c24f33f 100644 --- a/source/client/startup.cpp +++ b/source/client/startup.cpp @@ -26,6 +26,7 @@ using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; int uda::client::udaStartup(int reset, CLIENT_FLAGS* client_flags, bool* reopen_logs) { diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index cc6b974d..e34d5a99 100644 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -37,6 +37,7 @@ using namespace uda::authentication; using namespace uda::client_server; using namespace uda::client; +using namespace uda::logging; //------------------------------------------------ Static Globals ------------------------------------------------------ diff --git a/source/client/udaClientHostList.cpp b/source/client/udaClientHostList.cpp index 9b1b5b2b..333a7d5f 100644 --- a/source/client/udaClientHostList.cpp +++ b/source/client/udaClientHostList.cpp @@ -16,9 +16,10 @@ #endif #include "client/udaClientHostList.h" -#include "clientserver/stringUtils.h" #include "logging/logging.h" +using namespace uda::logging; + static std::vector g_host_list = {}; void uda::client::udaClientFreeHostList() diff --git a/source/client2/client.cpp b/source/client2/client.cpp index 00140b2d..1b11fb9e 100644 --- a/source/client2/client.cpp +++ b/source/client2/client.cpp @@ -20,6 +20,7 @@ #include "uda/client.h" using namespace uda::client_server; +using namespace uda::logging; namespace { diff --git a/source/client2/client_environment.cpp b/source/client2/client_environment.cpp index 06cbcf25..2c8681da 100644 --- a/source/client2/client_environment.cpp +++ b/source/client2/client_environment.cpp @@ -3,6 +3,8 @@ #include #include +using namespace uda::logging; + uda::client_server::Environment uda::client::load_environment(bool* env_host, bool* env_port) { char* env = nullptr; diff --git a/source/client2/client_xdr_stream.cpp b/source/client2/client_xdr_stream.cpp index 735e7300..73e4c32f 100644 --- a/source/client2/client_xdr_stream.cpp +++ b/source/client2/client_xdr_stream.cpp @@ -14,6 +14,8 @@ using namespace uda::authentication; #endif +using namespace uda::logging; + std::pair uda::client::createXDRStream(IoData* io_data) { static XDR client_input = {}; diff --git a/source/client2/closedown.cpp b/source/client2/closedown.cpp index 09712f1e..33d32c4a 100644 --- a/source/client2/closedown.cpp +++ b/source/client2/closedown.cpp @@ -10,6 +10,8 @@ using namespace uda::authentication; #endif +using namespace uda::logging; + int uda::client::closedown(ClosedownType type, Connection* connection, XDR* client_input, XDR* client_output, bool* reopen_logs, bool* env_host, bool* env_port) { diff --git a/source/client2/connection.cpp b/source/client2/connection.cpp index c5950bea..c33187dd 100644 --- a/source/client2/connection.cpp +++ b/source/client2/connection.cpp @@ -61,6 +61,7 @@ using namespace uda::authentication; #define PORT_STRING 64 using namespace uda::client_server; +using namespace uda::logging; int uda::client::Connection::open() { diff --git a/source/client2/host_list.cpp b/source/client2/host_list.cpp index 9587b628..142b2f64 100644 --- a/source/client2/host_list.cpp +++ b/source/client2/host_list.cpp @@ -13,9 +13,10 @@ #endif #include "client/udaClientHostList.h" -#include "clientserver/stringUtils.h" #include "logging/logging.h" +using namespace uda::logging; + const uda::client_server::HostData* uda::client::HostList::find_by_alias(std::string_view alias) const { for (const auto& data : hosts_) { diff --git a/source/clientserver/allocData.cpp b/source/clientserver/allocData.cpp index 0e684d50..0f6b39de 100644 --- a/source/clientserver/allocData.cpp +++ b/source/clientserver/allocData.cpp @@ -16,6 +16,8 @@ #include "initStructs.h" #include "udaErrors.h" +using namespace uda::logging; + /** * Generic function to (Re)Allocate Memory for a typed Array * @param data_type diff --git a/source/clientserver/errorLog.cpp b/source/clientserver/errorLog.cpp index dd065e5a..f6ed4986 100644 --- a/source/clientserver/errorLog.cpp +++ b/source/clientserver/errorLog.cpp @@ -7,6 +7,8 @@ #include "logging/logging.h" #include "uda/client.h" +using namespace uda::logging; + static std::vector udaerrorstack; int udaNumErrors(void) diff --git a/source/clientserver/expand_path.cpp b/source/clientserver/expand_path.cpp index b8bcf3d0..ffa2d1cf 100644 --- a/source/clientserver/expand_path.cpp +++ b/source/clientserver/expand_path.cpp @@ -59,6 +59,7 @@ void expandFilePath(char* path) # define MAXPATHSUBSLENGTH 256 using namespace uda::client_server; +using namespace uda::logging; /** * The workstation (client host) name is obtained using the operating system command 'hostname'. diff --git a/source/clientserver/makeRequestBlock.cpp b/source/clientserver/makeRequestBlock.cpp index 6c8c7f65..95ffc6f2 100644 --- a/source/clientserver/makeRequestBlock.cpp +++ b/source/clientserver/makeRequestBlock.cpp @@ -37,6 +37,7 @@ #define MAXREQDEPTH 4 // Maximum number of Device Name to Server Protocol and Host substitution using namespace uda::client_server; +using namespace uda::logging; static void extract_function_name(const char* str, REQUEST_DATA* request); diff --git a/source/clientserver/make_request_block.cpp b/source/clientserver/make_request_block.cpp index 4ff8679e..8f0c0de7 100644 --- a/source/clientserver/make_request_block.cpp +++ b/source/clientserver/make_request_block.cpp @@ -10,6 +10,7 @@ using namespace uda::client_server; using namespace uda::plugins; +using namespace uda::logging; static const boost::regex SOURCE_RE( R"(^(?(?:[a-z]+::)*)(((?[0-9]+)(\/(?[0-9a-z]+))?)|(?\/[a-z0-9\/\.]+)|((?[a-z]+)\((?.*)\)))$)", diff --git a/source/clientserver/nameValueSubstitution.cpp b/source/clientserver/nameValueSubstitution.cpp index 6357c351..ae2d234d 100644 --- a/source/clientserver/nameValueSubstitution.cpp +++ b/source/clientserver/nameValueSubstitution.cpp @@ -17,6 +17,7 @@ #include using namespace uda::client_server; +using namespace uda::logging; static void embedded_value_substitution(NAMEVALUELIST* nameValueList); diff --git a/source/clientserver/parseXML.cpp b/source/clientserver/parseXML.cpp index 13ec451b..b3e41c7b 100644 --- a/source/clientserver/parseXML.cpp +++ b/source/clientserver/parseXML.cpp @@ -22,13 +22,13 @@ #include "logging/logging.h" using namespace uda::client_server; +using namespace uda::logging; #ifndef NOXMLPARSER # include "clientserver/errorLog.h" # include "clientserver/parseOperation.h" # include "clientserver/stringUtils.h" -# include static double deScale(char* scale); static void parse_target_value(xmlDocPtr doc, xmlNodePtr cur, const char* target, double* value); diff --git a/source/clientserver/printStructs.cpp b/source/clientserver/printStructs.cpp index fc30deca..aea4a944 100644 --- a/source/clientserver/printStructs.cpp +++ b/source/clientserver/printStructs.cpp @@ -6,9 +6,9 @@ #include "clientserver/errorLog.h" #include "logging/logging.h" -#include using namespace uda::client_server; +using namespace uda::logging; void uda::client_server::printRequestData(REQUEST_DATA str) { diff --git a/source/clientserver/protocol.cpp b/source/clientserver/protocol.cpp index ccb7a306..35988bbe 100644 --- a/source/clientserver/protocol.cpp +++ b/source/clientserver/protocol.cpp @@ -25,7 +25,6 @@ #include "logging/logging.h" #include -#include #include "allocData.h" #include "compressDim.h" @@ -40,6 +39,7 @@ #endif using namespace uda::client_server; +using namespace uda::logging; void uda::client_server::setSelectParms(int fd, fd_set* rfds, struct timeval* tv, int* server_tot_block_time) { diff --git a/source/clientserver/protocol2.cpp b/source/clientserver/protocol2.cpp index 40f16b66..6ddcc8ff 100644 --- a/source/clientserver/protocol2.cpp +++ b/source/clientserver/protocol2.cpp @@ -40,6 +40,7 @@ #include "udaErrors.h" using namespace uda::client_server; +using namespace uda::logging; static int handle_request_block(XDR* xdrs, int direction, const void* str, int protocolVersion); static int handle_data_block(XDR* xdrs, int direction, const void* str, int protocolVersion); diff --git a/source/clientserver/protocolXML.cpp b/source/clientserver/protocolXML.cpp index c7031433..2834c8f0 100644 --- a/source/clientserver/protocolXML.cpp +++ b/source/clientserver/protocolXML.cpp @@ -72,6 +72,7 @@ #include "xdrlib.h" using namespace uda::client_server; +using namespace uda::logging; int uda::client_server::protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, void* str, int protocolVersion, diff --git a/source/clientserver/protocolXML2.cpp b/source/clientserver/protocolXML2.cpp index af52205e..3dc0e4f0 100644 --- a/source/clientserver/protocolXML2.cpp +++ b/source/clientserver/protocolXML2.cpp @@ -85,6 +85,7 @@ #define PARTBLOCKOUTPUT 3 using namespace uda::client_server; +using namespace uda::logging; extern "C" { diff --git a/source/clientserver/protocolXML2Put.cpp b/source/clientserver/protocolXML2Put.cpp index 76fc1144..c5e7a7eb 100644 --- a/source/clientserver/protocolXML2Put.cpp +++ b/source/clientserver/protocolXML2Put.cpp @@ -17,6 +17,7 @@ #endif using namespace uda::client_server; +using namespace uda::logging; static int recursiveDepthPut = 0; // Keep count of recursive calls diff --git a/source/clientserver/readXDRFile.cpp b/source/clientserver/readXDRFile.cpp index 4e6f9874..6a0bc5bf 100644 --- a/source/clientserver/readXDRFile.cpp +++ b/source/clientserver/readXDRFile.cpp @@ -13,6 +13,7 @@ #define MAXDOLOOPLIMIT 500 // ~50MB file using namespace uda::client_server; +using namespace uda::logging; int uda::client_server::sendXDRFile(XDR* xdrs, const char* xdrfile) { diff --git a/source/clientserver/udaStructs.cpp b/source/clientserver/udaStructs.cpp index 2ab7bec3..b2c4c053 100644 --- a/source/clientserver/udaStructs.cpp +++ b/source/clientserver/udaStructs.cpp @@ -4,6 +4,8 @@ #include +using namespace uda::logging; + void uda::client_server::freePutDataBlockList(PutDataBlockList* putDataBlockList) { if (putDataBlockList->putDataBlock != nullptr && putDataBlockList->blockListSize > 0) { diff --git a/source/clientserver/xdrlib.cpp b/source/clientserver/xdrlib.cpp index b580c334..23a20bc8 100644 --- a/source/clientserver/xdrlib.cpp +++ b/source/clientserver/xdrlib.cpp @@ -21,6 +21,7 @@ #include "structures/struct.h" using namespace uda::client_server; +using namespace uda::logging; //----------------------------------------------------------------------- // Test version's type passing capability diff --git a/source/logging/accessLog.cpp b/source/logging/accessLog.cpp index d08873e8..f8e773d4 100644 --- a/source/logging/accessLog.cpp +++ b/source/logging/accessLog.cpp @@ -33,7 +33,7 @@ using namespace uda::client_server; -unsigned int countDataBlockListSize(const DATA_BLOCK_LIST* data_block_list, CLIENT_BLOCK* client_block) +unsigned int uda::logging::countDataBlockListSize(const DATA_BLOCK_LIST* data_block_list, CLIENT_BLOCK* client_block) { unsigned int total = 0; for (int i = 0; i < data_block_list->count; ++i) { @@ -42,7 +42,7 @@ unsigned int countDataBlockListSize(const DATA_BLOCK_LIST* data_block_list, CLIE return total; } -unsigned int countDataBlockSize(const DATA_BLOCK* data_block, CLIENT_BLOCK* client_block) +unsigned int uda::logging::countDataBlockSize(const DATA_BLOCK* data_block, CLIENT_BLOCK* client_block) { int factor; DIMS dim; @@ -101,8 +101,8 @@ unsigned int countDataBlockSize(const DATA_BLOCK* data_block, CLIENT_BLOCK* clie #if defined(SERVERBUILD) || defined(FATCLIENT) -void udaAccessLog(int init, CLIENT_BLOCK client_block, REQUEST_BLOCK request_block, SERVER_BLOCK server_block, - unsigned int total_datablock_size) +void uda::logging::udaAccessLog(int init, CLIENT_BLOCK client_block, REQUEST_BLOCK request_block, + SERVER_BLOCK server_block, unsigned int total_datablock_size) { int err = 0; diff --git a/source/logging/accessLog.h b/source/logging/accessLog.h index e4805df6..bab7664d 100644 --- a/source/logging/accessLog.h +++ b/source/logging/accessLog.h @@ -1,17 +1,16 @@ -#ifndef UDA_LOGGING_ACCESSLOG_H -#define UDA_LOGGING_ACCESSLOG_H +#pragma once #include "clientserver/udaStructs.h" #define HOSTNAMELENGTH 20 #define DATELENGTH 27 -#ifdef __cplusplus -extern "C" { -#endif +namespace uda::logging +{ unsigned int countDataBlockListSize(const uda::client_server::DATA_BLOCK_LIST* data_block_list, uda::client_server::CLIENT_BLOCK* client_block); + unsigned int countDataBlockSize(const uda::client_server::DATA_BLOCK* data_block, uda::client_server::CLIENT_BLOCK* client_block); @@ -19,8 +18,4 @@ void udaAccessLog(int init, uda::client_server::CLIENT_BLOCK client_block, uda::client_server::REQUEST_BLOCK request_block, uda::client_server::SERVER_BLOCK server_block, unsigned int total_datablock_size); -#ifdef __cplusplus -} -#endif - -#endif // UDA_LOGGING_ACCESSLOG_H \ No newline at end of file +} // namespace uda::logging diff --git a/source/logging/fileLogging.cpp b/source/logging/fileLogging.cpp index 77b79834..875a8558 100644 --- a/source/logging/fileLogging.cpp +++ b/source/logging/fileLogging.cpp @@ -2,6 +2,8 @@ #include +using namespace uda::logging; + int reopen_logs = 0; // No need to Re-Open Logs static FILE* error_log = nullptr; @@ -12,12 +14,12 @@ static FILE* access_log = nullptr; static LOG_LEVEL log_level = UDA_LOG_NONE; -void udaSetLogLevel(LOG_LEVEL level) +void uda::logging::udaSetLogLevel(LOG_LEVEL level) { log_level = level; } -LOG_LEVEL udaGetLogLevel() +LOG_LEVEL uda::logging::udaGetLogLevel() { return log_level; } @@ -40,7 +42,7 @@ static FILE* idamGetLogFile(LOG_LEVEL mode) } } -void udaSetLogFile(LOG_LEVEL mode, FILE* file) +void uda::logging::udaSetLogFile(LOG_LEVEL mode, FILE* file) { switch (mode) { case UDA_LOG_ACCESS: @@ -63,7 +65,7 @@ void udaSetLogFile(LOG_LEVEL mode, FILE* file) } } -void udaLogWithFunc(LOG_LEVEL mode, logFunc func) +void uda::logging::udaLogWithFunc(LOG_LEVEL mode, logFunc func) { FILE* log_file = idamGetLogFile(mode); @@ -73,7 +75,7 @@ void udaLogWithFunc(LOG_LEVEL mode, logFunc func) } } -void udaLog(LOG_LEVEL mode, const char* fmt, ...) +void uda::logging::udaLog(LOG_LEVEL mode, const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -88,7 +90,7 @@ void udaLog(LOG_LEVEL mode, const char* fmt, ...) va_end(args); } -void udaCloseLogging() +void uda::logging::udaCloseLogging() { if (access_log != nullptr) { fclose(access_log); diff --git a/source/logging/logging.h b/source/logging/logging.h index ec5ef46a..c0370738 100644 --- a/source/logging/logging.h +++ b/source/logging/logging.h @@ -1,5 +1,4 @@ -#ifndef UDA_LOGGING_LOGGING_H -#define UDA_LOGGING_LOGGING_H +#pragma once #include #include @@ -33,9 +32,8 @@ } while (0) #endif -#ifdef __cplusplus -extern "C" { -#endif +namespace uda::logging +{ typedef enum LogLevel { UDA_LOG_DEBUG = 1, @@ -49,14 +47,15 @@ typedef enum LogLevel { typedef void (*logFunc)(FILE*); void udaSetLogLevel(LOG_LEVEL level); + LOG_LEVEL udaGetLogLevel(); + void udaCloseLogging(); + void udaSetLogFile(LOG_LEVEL mode, FILE* file); + void udaLogWithFunc(LOG_LEVEL mode, logFunc func); -void udaLog(LOG_LEVEL mode, const char* fmt, ...); -#ifdef __cplusplus -} -#endif +void udaLog(LOG_LEVEL mode, const char* fmt, ...); -#endif // UDA_LOGGING_LOGGING_H +} // namespace uda::logging diff --git a/source/logging/sysLogging.cpp b/source/logging/sysLogging.cpp index ae5c3d12..cb795704 100644 --- a/source/logging/sysLogging.cpp +++ b/source/logging/sysLogging.cpp @@ -4,26 +4,28 @@ #include #include +using namespace uda::logging; + static LOG_LEVEL log_level = UDA_LOG_NONE; int reopen_logs = 0; // No need to Re-Open Logs -void udaSetLogLevel(LOG_LEVEL level) +void uda::logging::udaSetLogLevel(LOG_LEVEL level) { log_level = level; } -LOG_LEVEL udaGetLogLevel() +LOG_LEVEL uda::logging::udaGetLogLevel() { return log_level; } -void udaCloseLogging() +void uda::logging::udaCloseLogging() { closelog(); } -void udaSetLogFile(LOG_LEVEL mode, FILE* file) +void uda::logging::udaSetLogFile(LOG_LEVEL mode, FILE* file) { openlog("uda", 0, 0); } @@ -46,7 +48,7 @@ static int syslogPriority(LOG_LEVEL log_mode) } } -void udaLogWithFunc(LOG_LEVEL mode, logFunc func) +void uda::logging::udaLogWithFunc(LOG_LEVEL mode, logFunc func) { char tmpFileName[] = "UdaTempLogXXXXXX"; @@ -66,7 +68,7 @@ void udaLogWithFunc(LOG_LEVEL mode, logFunc func) fclose(tmpFile); } -void udaLog(LOG_LEVEL mode, const char* fmt, ...) +void uda::logging::udaLog(LOG_LEVEL mode, const char* fmt, ...) { if (mode >= log_level) { int priority = syslogPriority(mode); diff --git a/source/plugins/managePluginFiles.cpp b/source/plugins/managePluginFiles.cpp index d61bc1dc..31868050 100644 --- a/source/plugins/managePluginFiles.cpp +++ b/source/plugins/managePluginFiles.cpp @@ -15,6 +15,8 @@ #define UDA_PLUGIN_FILE_ALLOC 10 #define MAX_OPEN_PLUGIN_FILE_DESC 50 +using namespace uda::logging; + // Initialise the File List and allocate heap for the list void initIdamPluginFileList(UDA_PLUGIN_FILE_LIST* uda_files) diff --git a/source/plugins/udaPlugin.cpp b/source/plugins/udaPlugin.cpp index 3f5608ec..65528601 100644 --- a/source/plugins/udaPlugin.cpp +++ b/source/plugins/udaPlugin.cpp @@ -24,6 +24,7 @@ using namespace uda::client_server; using namespace uda::server; using namespace uda::plugins; +using namespace uda::logging; UDA_PLUGIN_INTERFACE* udaCreatePluginInterface(const char* request) { diff --git a/source/server/applyXML.cpp b/source/server/applyXML.cpp index ed8e3097..04c0d9cb 100644 --- a/source/server/applyXML.cpp +++ b/source/server/applyXML.cpp @@ -21,6 +21,8 @@ #include "logging/logging.h" #include +using namespace uda::logging; + int uda::server::serverParseSignalXML(uda::client_server::DATA_SOURCE data_source, uda::client_server::SIGNAL signal, uda::client_server::SIGNAL_DESC signal_desc, uda::client_server::ACTIONS* actions_desc, diff --git a/source/server/fatServer.cpp b/source/server/fatServer.cpp index fe8b97df..e081563e 100644 --- a/source/server/fatServer.cpp +++ b/source/server/fatServer.cpp @@ -31,6 +31,7 @@ void ncclose(int fh) {} using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; static uda::plugins::PluginList pluginList; // List of all data reader plugins (internal and external shared libraries) ENVIRONMENT environment; // Holds local environment variable values diff --git a/source/server/getPluginAddress.cpp b/source/server/getPluginAddress.cpp index 4a12d552..6c92622f 100644 --- a/source/server/getPluginAddress.cpp +++ b/source/server/getPluginAddress.cpp @@ -9,6 +9,7 @@ using namespace uda::client_server; using namespace uda::plugins; +using namespace uda::logging; /** * Return the function address for plugin data readers located in external shared libraries diff --git a/source/server/getServerEnvironment.cpp b/source/server/getServerEnvironment.cpp index 6f27fd2b..fa86df8d 100644 --- a/source/server/getServerEnvironment.cpp +++ b/source/server/getServerEnvironment.cpp @@ -4,6 +4,8 @@ #include "logging/logging.h" +using namespace uda::logging; + // 2019-07-04 Herve Ancher (CEA): Add prefix "g_" to avoid conflict with internal MinGW varaible static uda::client_server::Environment g_environ; diff --git a/source/server/serverGetData.cpp b/source/server/serverGetData.cpp index d5760558..ad8b77cc 100644 --- a/source/server/serverGetData.cpp +++ b/source/server/serverGetData.cpp @@ -24,6 +24,7 @@ using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; static int swap_signal_error(DATA_BLOCK* data_block, DATA_BLOCK* data_block2, int asymmetry); static int swap_signal_dim(DIMCOMPOSITE dimcomposite, DATA_BLOCK* data_block, DATA_BLOCK* data_block2); diff --git a/source/server/serverLegacyPlugin.cpp b/source/server/serverLegacyPlugin.cpp index c1ddf41f..b712e8bc 100644 --- a/source/server/serverLegacyPlugin.cpp +++ b/source/server/serverLegacyPlugin.cpp @@ -15,6 +15,7 @@ using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; int uda::server::udaServerLegacyPlugin(REQUEST_DATA* request, DATA_SOURCE* data_source, SIGNAL_DESC* signal_desc) { diff --git a/source/server/serverPlugin.cpp b/source/server/serverPlugin.cpp index 02a5a47d..9a1ddf33 100644 --- a/source/server/serverPlugin.cpp +++ b/source/server/serverPlugin.cpp @@ -33,6 +33,7 @@ using namespace uda::client_server; using namespace uda::server; using namespace uda::plugins; +using namespace uda::logging; /** * Find the Plugin identity: return the reference id or -1 if not found. diff --git a/source/server/serverProcessing.cpp b/source/server/serverProcessing.cpp index ddd144a6..b89b64fb 100644 --- a/source/server/serverProcessing.cpp +++ b/source/server/serverProcessing.cpp @@ -3,7 +3,8 @@ #include #include "logging/logging.h" -#include + +using namespace uda::logging; template bool reduce_dim(uda::client_server::DIMS* ddim) { diff --git a/source/server/serverStartup.cpp b/source/server/serverStartup.cpp index fe5ac371..56f37991 100644 --- a/source/server/serverStartup.cpp +++ b/source/server/serverStartup.cpp @@ -11,6 +11,7 @@ using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; int uda::server::startup() { diff --git a/source/server/serverSubsetData.cpp b/source/server/serverSubsetData.cpp index c77677a9..4fddee17 100644 --- a/source/server/serverSubsetData.cpp +++ b/source/server/serverSubsetData.cpp @@ -33,6 +33,7 @@ using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; //---------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------- diff --git a/source/server/sleepServer.cpp b/source/server/sleepServer.cpp index 7ac08c03..89dcfe2b 100644 --- a/source/server/sleepServer.cpp +++ b/source/server/sleepServer.cpp @@ -14,6 +14,7 @@ #include "server/udaServer.h" using namespace uda::client_server; +using namespace uda::logging; int uda::server::sleepServer(XDR* server_input, XDR* server_output, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, diff --git a/source/server/udaLegacyServer.cpp b/source/server/udaLegacyServer.cpp index 4a7dd747..9a0a260a 100644 --- a/source/server/udaLegacyServer.cpp +++ b/source/server/udaLegacyServer.cpp @@ -34,6 +34,7 @@ int idamLegacyServer(CLIENT_BLOCK client_block) using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; constexpr int server_version = 8; diff --git a/source/server/udaServer.cpp b/source/server/udaServer.cpp index dcab2a5a..9559da0c 100644 --- a/source/server/udaServer.cpp +++ b/source/server/udaServer.cpp @@ -46,6 +46,7 @@ using namespace uda::authentication; using namespace uda::client_server; using namespace uda::server; +using namespace uda::logging; //-------------------------------------------------------------------------------------- // static globals diff --git a/source/server/writer.cpp b/source/server/writer.cpp index bfe454b1..161902f2 100644 --- a/source/server/writer.cpp +++ b/source/server/writer.cpp @@ -40,6 +40,7 @@ int serverSocket = 0; */ using namespace uda::client_server; +using namespace uda::logging; int uda::server::server_read(void* iohandle, char* buf, int count) { diff --git a/source/server2/apply_XML.cpp b/source/server2/apply_XML.cpp index b08de465..4ab5df2f 100644 --- a/source/server2/apply_XML.cpp +++ b/source/server2/apply_XML.cpp @@ -21,6 +21,8 @@ #include "logging/logging.h" #include +using namespace uda::logging; + int uda::server_parse_signal_XML(uda::client_server::DATA_SOURCE data_source, uda::client_server::SIGNAL signal, uda::client_server::SIGNAL_DESC signal_desc, uda::client_server::ACTIONS* actions_desc, uda::client_server::ACTIONS* actions_sig) diff --git a/source/server2/get_data.cpp b/source/server2/get_data.cpp index 61326688..e6722198 100644 --- a/source/server2/get_data.cpp +++ b/source/server2/get_data.cpp @@ -17,6 +17,7 @@ using namespace uda::client_server; using namespace uda::plugins; +using namespace uda::logging; namespace { diff --git a/source/server2/get_plugin_address.cpp b/source/server2/get_plugin_address.cpp index 20a700d8..7577a711 100644 --- a/source/server2/get_plugin_address.cpp +++ b/source/server2/get_plugin_address.cpp @@ -9,6 +9,7 @@ using namespace uda::client_server; using namespace uda::plugins; +using namespace uda::logging; /** * Return the function address for plugin data readers located in external shared libraries diff --git a/source/server2/plugins.cpp b/source/server2/plugins.cpp index 643ac1ac..5ee3bb31 100644 --- a/source/server2/plugins.cpp +++ b/source/server2/plugins.cpp @@ -16,6 +16,7 @@ using namespace uda::client_server; using namespace uda::plugins; +using namespace uda::logging; namespace { diff --git a/source/server2/server.cpp b/source/server2/server.cpp index 10ff8ca6..9730c307 100644 --- a/source/server2/server.cpp +++ b/source/server2/server.cpp @@ -23,6 +23,7 @@ using namespace uda::authentication; #endif using namespace uda::client_server; +using namespace uda::logging; void free_data_blocks(std::vector& data_blocks) { diff --git a/source/server2/server_environment.cpp b/source/server2/server_environment.cpp index d5072772..d83ca853 100644 --- a/source/server2/server_environment.cpp +++ b/source/server2/server_environment.cpp @@ -6,6 +6,8 @@ #include "logging/logging.h" +using namespace uda::logging; + void uda::server::Environment::print() { UDA_LOG(UDA_LOG_INFO, "Server Environment Variable values\n"); diff --git a/source/server2/server_plugin.cpp b/source/server2/server_plugin.cpp index 0c059039..bd393475 100644 --- a/source/server2/server_plugin.cpp +++ b/source/server2/server_plugin.cpp @@ -34,6 +34,7 @@ using namespace uda::client_server; using namespace uda::plugins; +using namespace uda::logging; int uda::serverRedirectStdStreams(int reset) { diff --git a/source/server2/server_processing.cpp b/source/server2/server_processing.cpp index cfecfd07..1a48f9d3 100644 --- a/source/server2/server_processing.cpp +++ b/source/server2/server_processing.cpp @@ -5,6 +5,8 @@ #include "logging/logging.h" #include +using namespace uda::logging; + /** * UDA Server Side Data Processing * diff --git a/source/server2/server_subset_data.cpp b/source/server2/server_subset_data.cpp index 7d1ba29d..12a94510 100644 --- a/source/server2/server_subset_data.cpp +++ b/source/server2/server_subset_data.cpp @@ -44,6 +44,7 @@ // using namespace uda::client_server; +using namespace uda::logging; namespace { diff --git a/source/server2/xdr_protocol.cpp b/source/server2/xdr_protocol.cpp index 7d477fe5..75d5315b 100644 --- a/source/server2/xdr_protocol.cpp +++ b/source/server2/xdr_protocol.cpp @@ -32,6 +32,7 @@ using namespace uda::authentication; #endif using namespace uda::client_server; +using namespace uda::logging; int serverSocket = 0; diff --git a/source/structures/accessors.cpp b/source/structures/accessors.cpp index c9d8fee2..01030283 100644 --- a/source/structures/accessors.cpp +++ b/source/structures/accessors.cpp @@ -54,6 +54,8 @@ #include "logging/logging.h" #include "struct.h" +using namespace uda::logging; + /** Find (search type A) the first Tree Node with a data structure type containing a named element/member. * * This is a private function with the whole sub-tree in scope. diff --git a/source/structures/struct.cpp b/source/structures/struct.cpp index 4f7f04ef..0392c887 100644 --- a/source/structures/struct.cpp +++ b/source/structures/struct.cpp @@ -68,6 +68,7 @@ #endif using namespace uda::client_server; +using namespace uda::logging; static unsigned int last_malloc_index = 0; // Malloc Log search index last value static unsigned int* last_malloc_index_value = diff --git a/source/structures/xdrUserDefinedData.cpp b/source/structures/xdrUserDefinedData.cpp index 0c9fb76f..7c66bdfd 100644 --- a/source/structures/xdrUserDefinedData.cpp +++ b/source/structures/xdrUserDefinedData.cpp @@ -10,6 +10,7 @@ #include "logging/logging.h" using namespace uda::client_server; +using namespace uda::logging; static int recursiveDepth = 0; // Keep count of recursive calls