Skip to content

Commit 218d81c

Browse files
committed
Revert "Temporary added verbose function logging for sa_plugin_process.cpp plugin."
This reverts commit 444e17a.
1 parent c752c0f commit 218d81c

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

src/plugins/sa_plugin_process/sa_plugin_process.cpp

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -42,63 +42,6 @@
4242

4343
#define EXPORT_API __declspec(dllexport)
4444

45-
class ScopeLogger2
46-
{
47-
public:
48-
/// <summary>
49-
/// Argument struct for a ScopeManager
50-
/// </summary>
51-
struct ARGS
52-
{
53-
///<summary>The souce code filename generating the log entries.</summary>
54-
const char* filename;
55-
///<summary>The souce code line number generating the log entries.</summary>
56-
int line;
57-
///<summary>The level to use while producing log entries.</summary>
58-
sa_log_level_t level;
59-
///<summary>The name to use while generating logs. Usually the function name.</summary>
60-
const char* name;
61-
};
62-
63-
public:
64-
ScopeLogger2(const ScopeLogger2::ARGS* args_) :
65-
args(args_)
66-
{
67-
// Prepare output text
68-
std::string text;
69-
text += args->name;
70-
71-
sa_logging_print_format(args->level, "sa_plugin_process", "%s", text.c_str());
72-
}
73-
74-
~ScopeLogger2()
75-
{
76-
// Prepare output text
77-
std::string text;
78-
text += args->name;
79-
text += " - returns";
80-
81-
sa_logging_print_format(args->level, "sa_plugin_process", "%s", text.c_str());
82-
}
83-
84-
private:
85-
// Disable copy constructor and copy operator
86-
ScopeLogger2(const ScopeLogger2&);
87-
ScopeLogger2& operator=(const ScopeLogger2&);
88-
89-
public:
90-
const ARGS* args;
91-
};
92-
93-
#ifndef SA_DECLARE_SCOPE_LOGGER_ARGS
94-
#define SA_DECLARE_SCOPE_LOGGER_ARGS(info) \
95-
::ScopeLogger2::ARGS info = {0};\
96-
info.filename = __FILE__;\
97-
info.line = __LINE__;\
98-
info.name = __FUNCTION__ "()";\
99-
info.level = SA_LOG_LEVEL_INFO;
100-
#endif
101-
10245
#ifdef __cplusplus
10346
extern "C" {
10447
#if 0
@@ -143,9 +86,6 @@ void parse_string_dword(const char* str, DWORD& value)
14386
// https://stackoverflow.com/questions/13179410/check-whether-one-specific-process-is-running-on-windows-with-c
14487
DWORD find_process_id_from_name(const char* process_name)
14588
{
146-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
147-
ScopeLogger2 logger(&sli);
148-
14989
// strip path
15090
const char* p = strrchr(process_name, '\\');
15191
if (p)
@@ -180,9 +120,6 @@ DWORD find_process_id_from_name(const char* process_name)
180120

181121
bool process_id_exists(DWORD pid)
182122
{
183-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
184-
ScopeLogger2 logger(&sli);
185-
186123
PROCESSENTRY32 pi;
187124
pi.dwSize = sizeof(pi);
188125

@@ -212,9 +149,6 @@ bool process_id_exists(DWORD pid)
212149

213150
sa_error_t kill_process_by_pid(DWORD pid)
214151
{
215-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
216-
ScopeLogger2 logger(&sli);
217-
218152
bool success = false;
219153
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
220154
if (hProcess)
@@ -229,9 +163,6 @@ sa_error_t kill_process_by_pid(DWORD pid)
229163

230164
sa_error_t terminate_process_by_pid(DWORD pid)
231165
{
232-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
233-
ScopeLogger2 logger(&sli);
234-
235166
//ask the process to exit gracefully allowing a maximum of 60 seconds to close
236167
ULONGLONG time_start = GetTickCount64();
237168
bool terminated = ra::process::Terminate(pid);
@@ -254,9 +185,6 @@ sa_error_t terminate_process_by_pid(DWORD pid)
254185

255186
sa_error_t killprocess_event_create(sa_action_event_t evnt)
256187
{
257-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
258-
ScopeLogger2 logger(&sli);
259-
260188
const char* name = sa_plugin_action_get_name();
261189
const char* xml = sa_plugin_action_get_xml();
262190
sa_property_store_t* store = sa_plugin_action_get_property_store();
@@ -281,9 +209,6 @@ sa_error_t killprocess_event_create(sa_action_event_t evnt)
281209

282210
sa_error_t killprocess_event_execute(sa_action_event_t evnt)
283211
{
284-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
285-
ScopeLogger2 logger(&sli);
286-
287212
const char* action_name = sa_plugin_action_get_name();
288213
sa_property_store_t* store = sa_plugin_action_get_property_store();
289214

@@ -337,9 +262,6 @@ sa_error_t killprocess_event_execute(sa_action_event_t evnt)
337262

338263
sa_error_t killprocess_event(sa_action_event_t evnt)
339264
{
340-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
341-
ScopeLogger2 logger(&sli);
342-
343265
sa_error_t result;
344266
switch (evnt)
345267
{
@@ -362,9 +284,6 @@ sa_error_t killprocess_event(sa_action_event_t evnt)
362284

363285
sa_error_t terminateprocess_event_create(sa_action_event_t evnt)
364286
{
365-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
366-
ScopeLogger2 logger(&sli);
367-
368287
const char* name = sa_plugin_action_get_name();
369288
const char* xml = sa_plugin_action_get_xml();
370289
sa_property_store_t* store = sa_plugin_action_get_property_store();
@@ -389,9 +308,6 @@ sa_error_t terminateprocess_event_create(sa_action_event_t evnt)
389308

390309
sa_error_t terminateprocess_event_execute(sa_action_event_t evnt)
391310
{
392-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
393-
ScopeLogger2 logger(&sli);
394-
395311
const char* action_name = sa_plugin_action_get_name();
396312
sa_property_store_t* store = sa_plugin_action_get_property_store();
397313

@@ -445,9 +361,6 @@ sa_error_t terminateprocess_event_execute(sa_action_event_t evnt)
445361

446362
sa_error_t terminateprocess_event(sa_action_event_t evnt)
447363
{
448-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
449-
ScopeLogger2 logger(&sli);
450-
451364
sa_error_t result;
452365
switch (evnt)
453366
{
@@ -470,9 +383,6 @@ sa_error_t terminateprocess_event(sa_action_event_t evnt)
470383

471384
sa_boolean validate_process_filename()
472385
{
473-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
474-
ScopeLogger2 logger(&sli);
475-
476386
sa_selection_context_immutable_t* ctx = sa_plugin_validation_get_selection_context();
477387
sa_property_store_immutable_t* store = sa_plugin_validation_get_property_store();
478388

@@ -506,9 +416,6 @@ sa_boolean validate_process_filename()
506416

507417
sa_boolean validate_process_pid()
508418
{
509-
SA_DECLARE_SCOPE_LOGGER_ARGS(sli);
510-
ScopeLogger2 logger(&sli);
511-
512419
sa_selection_context_immutable_t* ctx = sa_plugin_validation_get_selection_context();
513420
sa_property_store_immutable_t* store = sa_plugin_validation_get_property_store();
514421

0 commit comments

Comments
 (0)