Skip to content

Commit

Permalink
Adding namespace to logging headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jholloc committed Feb 13, 2024
1 parent 0840681 commit 9bacfe6
Show file tree
Hide file tree
Showing 70 changed files with 117 additions and 42 deletions.
1 change: 1 addition & 0 deletions source/authentication/udaClientSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/authentication/udaServerSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

using namespace uda::client_server;
using namespace uda::server;
using namespace uda::logging;

/*
Note on initialisation:
Expand Down
1 change: 1 addition & 0 deletions source/c_api/accAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions source/c_api/clientAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions source/c_api/clientMDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using namespace uda::client_server;
using namespace uda::client;
using namespace uda::logging;

/**
* Reads the Requested Data
Expand Down
1 change: 1 addition & 0 deletions source/c_api/udaGetAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/c_api/udaPutAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions source/client/clientXDRStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
using namespace uda::authentication;
#endif

using namespace uda::logging;

std::pair<XDR*, XDR*> uda::client::clientCreateXDRStream()
{
static XDR client_input = {};
Expand Down
1 change: 1 addition & 0 deletions source/client/closedown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions source/client/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions source/client/getEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions source/client/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions source/client/udaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ using namespace uda::authentication;

using namespace uda::client_server;
using namespace uda::client;
using namespace uda::logging;

//------------------------------------------------ Static Globals ------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion source/client/udaClientHostList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
#endif

#include "client/udaClientHostList.h"
#include "clientserver/stringUtils.h"
#include "logging/logging.h"

using namespace uda::logging;

static std::vector<uda::client_server::HostData> g_host_list = {};

void uda::client::udaClientFreeHostList()
Expand Down
1 change: 1 addition & 0 deletions source/client2/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "uda/client.h"

using namespace uda::client_server;
using namespace uda::logging;

namespace
{
Expand Down
2 changes: 2 additions & 0 deletions source/client2/client_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <cstdlib>
#include <fmt/format.h>

using namespace uda::logging;

uda::client_server::Environment uda::client::load_environment(bool* env_host, bool* env_port)
{
char* env = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions source/client2/client_xdr_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
using namespace uda::authentication;
#endif

using namespace uda::logging;

std::pair<XDR*, XDR*> uda::client::createXDRStream(IoData* io_data)
{
static XDR client_input = {};
Expand Down
2 changes: 2 additions & 0 deletions source/client2/closedown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions source/client2/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion source/client2/host_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down
2 changes: 2 additions & 0 deletions source/clientserver/allocData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions source/clientserver/errorLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "logging/logging.h"
#include "uda/client.h"

using namespace uda::logging;

static std::vector<uda::client_server::UDA_ERROR> udaerrorstack;

int udaNumErrors(void)
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/expand_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/makeRequestBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions source/clientserver/make_request_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

using namespace uda::client_server;
using namespace uda::plugins;
using namespace uda::logging;

static const boost::regex SOURCE_RE(
R"(^(?<device>(?:[a-z]+::)*)(((?<pulse>[0-9]+)(\/(?<pass>[0-9a-z]+))?)|(?<path>\/[a-z0-9\/\.]+)|((?<function>[a-z]+)\((?<args>.*)\)))$)",
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/nameValueSubstitution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <fmt/format.h>

using namespace uda::client_server;
using namespace uda::logging;

static void embedded_value_substitution(NAMEVALUELIST* nameValueList);

Expand Down
2 changes: 1 addition & 1 deletion source/clientserver/parseXML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <uda/types.h>

static double deScale(char* scale);
static void parse_target_value(xmlDocPtr doc, xmlNodePtr cur, const char* target, double* value);
Expand Down
2 changes: 1 addition & 1 deletion source/clientserver/printStructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "clientserver/errorLog.h"
#include "logging/logging.h"
#include <uda/types.h>

using namespace uda::client_server;
using namespace uda::logging;

void uda::client_server::printRequestData(REQUEST_DATA str)
{
Expand Down
2 changes: 1 addition & 1 deletion source/clientserver/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "logging/logging.h"
#include <cstdlib>
#include <uda/types.h>

#include "allocData.h"
#include "compressDim.h"
Expand All @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/protocol2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/protocolXML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/protocolXML2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#define PARTBLOCKOUTPUT 3

using namespace uda::client_server;
using namespace uda::logging;

extern "C" {

Expand Down
1 change: 1 addition & 0 deletions source/clientserver/protocolXML2Put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#endif

using namespace uda::client_server;
using namespace uda::logging;

static int recursiveDepthPut = 0; // Keep count of recursive calls

Expand Down
1 change: 1 addition & 0 deletions source/clientserver/readXDRFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions source/clientserver/udaStructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <uda/types.h>

using namespace uda::logging;

void uda::client_server::freePutDataBlockList(PutDataBlockList* putDataBlockList)
{
if (putDataBlockList->putDataBlock != nullptr && putDataBlockList->blockListSize > 0) {
Expand Down
1 change: 1 addition & 0 deletions source/clientserver/xdrlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "structures/struct.h"

using namespace uda::client_server;
using namespace uda::logging;

//-----------------------------------------------------------------------
// Test version's type passing capability
Expand Down
8 changes: 4 additions & 4 deletions source/logging/accessLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
15 changes: 5 additions & 10 deletions source/logging/accessLog.h
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
#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);

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
} // namespace uda::logging
Loading

0 comments on commit 9bacfe6

Please sign in to comment.