From a7b8975d244554d0ca3182f20fb2378b2b9489ec Mon Sep 17 00:00:00 2001 From: Isak Jakobsson Date: Mon, 15 Sep 2025 09:13:47 +0200 Subject: [PATCH] Remove calles to openlog() --- axevent/send_event/app/send_event.c | 2 -- axevent/subscribe_to_event/app/subscribe_to_event.c | 2 -- axevent/subscribe_to_events/app/subscribe_to_events.c | 2 -- axoverlay/app/axoverlay.c | 2 -- axparameter/app/axparameter.c | 2 -- axserialport/app/axserialport.c | 3 --- axstorage/app/axstorage.c | 3 --- bounding-box/app/bounding_box_example.c | 2 -- curl-openssl/app/curl_openssl.c | 3 --- hello-world/app/hello_world.c | 3 --- licensekey/app/licensekey_handler.c | 3 +-- object-detection-cv25/app/object_detection.c | 3 --- object-detection-yolov5/app/object_detection_yolov5.c | 2 -- object-detection/app/object_detection.c | 3 --- remote-debug-example/app/remote_debug.c | 2 -- reproducible-package/app/reproducible_package.c | 3 --- using-opencv/app/example.cpp | 1 - .../custom_lib_example/app/custom_build/hello_world.c | 3 --- .../openssl_curl_example/app/openssl_curl_example.c | 3 --- vapix/app/vapix_example.c | 2 -- vdo-larod/app/vdo_larod.c | 4 ---- vdo-opencl-filtering/app/vdo_cl_filter_demo.c | 3 --- vdostream/app/vdoencodeclient.c | 2 -- web-server-using-fastcgi/app/fastcgi_example.c | 1 - 24 files changed, 1 insertion(+), 58 deletions(-) diff --git a/axevent/send_event/app/send_event.c b/axevent/send_event/app/send_event.c index 5e207e61..860b3d6e 100644 --- a/axevent/send_event/app/send_event.c +++ b/axevent/send_event/app/send_event.c @@ -190,8 +190,6 @@ gint main(void) { GMainLoop* main_loop = NULL; gdouble start_value = 0.0; - // Set up the user logging to syslog - openlog(NULL, LOG_PID, LOG_USER); syslog(LOG_INFO, "Started logging from send event application"); // Event handler diff --git a/axevent/subscribe_to_event/app/subscribe_to_event.c b/axevent/subscribe_to_event/app/subscribe_to_event.c index 58ae9f90..3532b8ed 100644 --- a/axevent/subscribe_to_event/app/subscribe_to_event.c +++ b/axevent/subscribe_to_event/app/subscribe_to_event.c @@ -125,8 +125,6 @@ int main(void) { guint subscription = 0; guint token = 1234; - // Set up the user logging to syslog - openlog(NULL, LOG_PID, LOG_USER); syslog(LOG_INFO, "Started logging from subscribe event application"); // Event handler diff --git a/axevent/subscribe_to_events/app/subscribe_to_events.c b/axevent/subscribe_to_events/app/subscribe_to_events.c index a4deeb00..d3c40800 100644 --- a/axevent/subscribe_to_events/app/subscribe_to_events.c +++ b/axevent/subscribe_to_events/app/subscribe_to_events.c @@ -513,8 +513,6 @@ int main(void) { // Initialize main loop main_loop = g_main_loop_new(NULL, FALSE); - // Set up the user logging to syslog - openlog(NULL, LOG_PID, LOG_USER); syslog(LOG_INFO, "Started logging from subscribe event application"); // Create an event handler diff --git a/axoverlay/app/axoverlay.c b/axoverlay/app/axoverlay.c index 107af7a5..84584941 100644 --- a/axoverlay/app/axoverlay.c +++ b/axoverlay/app/axoverlay.c @@ -366,8 +366,6 @@ int main(void) { gint camera_height = 0; gint camera_width = 0; - openlog(NULL, LOG_PID, LOG_USER); - // Create a glib main loop loop = g_main_loop_new(NULL, FALSE); g_unix_signal_add(SIGTERM, signal_handler, loop); diff --git a/axparameter/app/axparameter.c b/axparameter/app/axparameter.c index 9cf83f82..22ee18c5 100644 --- a/axparameter/app/axparameter.c +++ b/axparameter/app/axparameter.c @@ -177,8 +177,6 @@ int main(void) { GError* error = NULL; GMainLoop* loop = NULL; - openlog(APP_NAME, LOG_PID, LOG_USER); - // Passing in APP_NAME gives access to this application's parameters without qualifiers and // makes it possible to add or remove parameters. AXParameter* handle = ax_parameter_new(APP_NAME, &error); diff --git a/axserialport/app/axserialport.c b/axserialport/app/axserialport.c index ee43b029..33e59117 100644 --- a/axserialport/app/axserialport.c +++ b/axserialport/app/axserialport.c @@ -23,8 +23,6 @@ /* AX Serial Port library. */ #include -#define APP_NAME "axserialport" - /** * MyConfigAndData contains application configuration and data. */ @@ -175,7 +173,6 @@ int main(void) { g_unix_signal_add(SIGINT, signal_handler, loop); /* Print some startup messages */ - openlog(APP_NAME, LOG_PID, LOG_LOCAL4); syslog(LOG_INFO, "Starting AxSerialPort application"); /* Create a configuration for the first port (port0) */ diff --git a/axstorage/app/axstorage.c b/axstorage/app/axstorage.c index 3ed824af..2262fb7a 100644 --- a/axstorage/app/axstorage.c +++ b/axstorage/app/axstorage.c @@ -27,8 +27,6 @@ /* AX Storage library. */ #include -#define APP_NAME "axstorage" - /** * disk_item_t represents one storage device and its values. */ @@ -377,7 +375,6 @@ gint main(void) { GMainLoop* loop = NULL; gint ret = EXIT_SUCCESS; - openlog(APP_NAME, LOG_PID, LOG_USER); syslog(LOG_INFO, "Start AXStorage application"); disks = ax_storage_list(&error); diff --git a/bounding-box/app/bounding_box_example.c b/bounding-box/app/bounding_box_example.c index c9bf3b35..61a21f12 100644 --- a/bounding-box/app/bounding_box_example.c +++ b/bounding-box/app/bounding_box_example.c @@ -231,8 +231,6 @@ static void init_signals(void) { } int main(void) { - openlog(NULL, LOG_PID, LOG_USER); - init_signals(); for (bool once = true; running; once = false) { diff --git a/curl-openssl/app/curl_openssl.c b/curl-openssl/app/curl_openssl.c index f25db173..fd6bc360 100644 --- a/curl-openssl/app/curl_openssl.c +++ b/curl-openssl/app/curl_openssl.c @@ -114,9 +114,6 @@ int main(void) { "/usr/local/packages/curl_openssl/localdata/www.example.com.txt", NULL}; - // Start logging - openlog(NULL, LOG_PID, LOG_USER); - // Log the curl and openssl library versions used in the code curl_version_info_data* ver = curl_version_info(CURLVERSION_NOW); syslog(LOG_INFO, diff --git a/hello-world/app/hello_world.c b/hello-world/app/hello_world.c index 4d20c9f0..ad80b3c5 100644 --- a/hello-world/app/hello_world.c +++ b/hello-world/app/hello_world.c @@ -31,9 +31,6 @@ * This main function writes "hello_world" to the syslog. */ int main(void) { - /* Open the syslog to report messages for "hello_world" */ - openlog("hello_world", LOG_PID | LOG_CONS, LOG_USER); - /* Choose between { LOG_INFO, LOG_CRIT, LOG_WARNING, LOG_ERR }*/ syslog(LOG_INFO, "Hello World!"); } diff --git a/licensekey/app/licensekey_handler.c b/licensekey/app/licensekey_handler.c index 76fec991..7ac15712 100644 --- a/licensekey/app/licensekey_handler.c +++ b/licensekey/app/licensekey_handler.c @@ -69,8 +69,7 @@ int main(int argc, char* argv[]) { return EXIT_FAILURE; glob_app_name = g_path_get_basename(argv[0]); - openlog(glob_app_name, LOG_PID | LOG_CONS, LOG_USER); - loop = g_main_loop_new(NULL, FALSE); + loop = g_main_loop_new(NULL, FALSE); check_license_status(NULL); g_timeout_add_seconds(CHECK_SECS, check_license_status, NULL); diff --git a/object-detection-cv25/app/object_detection.c b/object-detection-cv25/app/object_detection.c index 784e05b7..8acab60b 100644 --- a/object-detection-cv25/app/object_detection.c +++ b/object-detection-cv25/app/object_detection.c @@ -477,9 +477,6 @@ int main(int argc, char** argv) { size_t numLabels = 0; // Number of entries in the labels array. char* labelFileData = NULL; // Buffer holding the complete collection of label strings. - // Open the syslog to report messages for "object_detection" - openlog("object_detection", LOG_PID | LOG_CONS, LOG_USER); - args_t args; if (!parseArgs(argc, argv, &args)) { syslog(LOG_ERR, "%s: Could not parse arguments", __func__); diff --git a/object-detection-yolov5/app/object_detection_yolov5.c b/object-detection-yolov5/app/object_detection_yolov5.c index b7d9b318..95c88c4c 100644 --- a/object-detection-yolov5/app/object_detection_yolov5.c +++ b/object-detection-yolov5/app/object_detection_yolov5.c @@ -248,8 +248,6 @@ int main(int argc, char** argv) { model_tensor_output_t* tensor_outputs = NULL; bbox_t* bbox = NULL; - openlog(APP_NAME, LOG_PID | LOG_CONS, LOG_USER); - // Stop main loop at signal signal(SIGTERM, shutdown); signal(SIGINT, shutdown); diff --git a/object-detection/app/object_detection.c b/object-detection/app/object_detection.c index 1a08cb02..d455aa09 100644 --- a/object-detection/app/object_detection.c +++ b/object-detection/app/object_detection.c @@ -428,9 +428,6 @@ int main(int argc, char** argv) { size_t numLabels = 0; // Number of entries in the labels array. char* labelFileData = NULL; // Buffer holding the complete collection of label strings. - // Open the syslog to report messages for "object_detection" - openlog("object_detection", LOG_PID | LOG_CONS, LOG_USER); - args_t args; if (!parseArgs(argc, argv, &args)) { syslog(LOG_ERR, "%s: Could not parse arguments", __func__); diff --git a/remote-debug-example/app/remote_debug.c b/remote-debug-example/app/remote_debug.c index f9ccb82b..abc300b8 100644 --- a/remote-debug-example/app/remote_debug.c +++ b/remote-debug-example/app/remote_debug.c @@ -17,8 +17,6 @@ #include int main(void) { - openlog("remote_debug", LOG_PID | LOG_CONS, LOG_USER); - /* Intentional error: attempting to modify a string literal */ char* message = "Hello World!"; message[0] = 'h'; // This will cause a segmentation fault diff --git a/reproducible-package/app/reproducible_package.c b/reproducible-package/app/reproducible_package.c index 232a33b4..31e94180 100644 --- a/reproducible-package/app/reproducible_package.c +++ b/reproducible-package/app/reproducible_package.c @@ -31,9 +31,6 @@ * This main function writes "Hello Reproducible World" to the syslog. */ int main(void) { - /* Open the syslog to report messages for "reproducible_package" */ - openlog("reproducible_package", LOG_PID | LOG_CONS, LOG_USER); - /* Choose between { LOG_INFO, LOG_CRIT, LOG_WARN, LOG_ERR }*/ syslog(LOG_INFO, "Hello Reproducible World!"); } diff --git a/using-opencv/app/example.cpp b/using-opencv/app/example.cpp index aaa19b32..e01f377a 100644 --- a/using-opencv/app/example.cpp +++ b/using-opencv/app/example.cpp @@ -29,7 +29,6 @@ using namespace cv; int main(void) { - openlog("opencv_app", LOG_PID | LOG_CONS, LOG_USER); syslog(LOG_INFO, "Running OpenCV example with VDO as video source"); img_provider_t* image_provider = nullptr; g_autoptr(GError) vdo_error = nullptr; diff --git a/utility-libraries/custom_lib_example/app/custom_build/hello_world.c b/utility-libraries/custom_lib_example/app/custom_build/hello_world.c index 531c2d8c..5314c673 100644 --- a/utility-libraries/custom_lib_example/app/custom_build/hello_world.c +++ b/utility-libraries/custom_lib_example/app/custom_build/hello_world.c @@ -32,9 +32,6 @@ * */ void log_hello_world(void) { - /* Open the syslog to report messages for "hello_world" */ - openlog("customlib_example", LOG_PID | LOG_CONS, LOG_USER); - /* Choose between { LOG_INFO, LOG_CRIT, LOG_WARN, LOG_ERR }*/ syslog(LOG_INFO, "Hello World!"); diff --git a/utility-libraries/openssl_curl_example/app/openssl_curl_example.c b/utility-libraries/openssl_curl_example/app/openssl_curl_example.c index f765b4f1..b04d441a 100644 --- a/utility-libraries/openssl_curl_example/app/openssl_curl_example.c +++ b/utility-libraries/openssl_curl_example/app/openssl_curl_example.c @@ -124,9 +124,6 @@ int main(void) { "/usr/local/packages/openssl_curl_example/localdata/www.example.com.txt", NULL}; - // Start logging - openlog(NULL, LOG_PID, LOG_USER); - // Log the curl and openssl library versions used in the code curl_version_info_data* ver = curl_version_info(CURLVERSION_NOW); syslog(LOG_INFO, diff --git a/vapix/app/vapix_example.c b/vapix/app/vapix_example.c index cf108973..4bc59b69 100644 --- a/vapix/app/vapix_example.c +++ b/vapix/app/vapix_example.c @@ -128,8 +128,6 @@ static const char* read_property(const json_t* all_props, const char* prop_name) } int main(void) { - openlog(NULL, LOG_PID, LOG_USER); - syslog(LOG_INFO, "Curl version %s", curl_version_info(CURLVERSION_NOW)->version); syslog(LOG_INFO, "Jansson version %s", JANSSON_VERSION); diff --git a/vdo-larod/app/vdo_larod.c b/vdo-larod/app/vdo_larod.c index c3602aeb..f27bd9b6 100644 --- a/vdo-larod/app/vdo_larod.c +++ b/vdo-larod/app/vdo_larod.c @@ -56,8 +56,6 @@ #include "vdo-frame.h" #include "vdo-types.h" -#define APP_NAME "vdo_larod" - volatile sig_atomic_t running = 1; static void shutdown(int status) { @@ -78,8 +76,6 @@ int main(int argc, char** argv) { model_provider_t* model_provider = NULL; model_tensor_output_t* tensor_outputs = NULL; - openlog(APP_NAME, LOG_PID | LOG_CONS, LOG_USER); - // Stop main loop at signal signal(SIGTERM, shutdown); signal(SIGINT, shutdown); diff --git a/vdo-opencl-filtering/app/vdo_cl_filter_demo.c b/vdo-opencl-filtering/app/vdo_cl_filter_demo.c index c0f7c24f..2af7377f 100644 --- a/vdo-opencl-filtering/app/vdo_cl_filter_demo.c +++ b/vdo-opencl-filtering/app/vdo_cl_filter_demo.c @@ -408,9 +408,6 @@ int main(void) { const char* kernel_name = FILTER_SOBEL_3X3; enum render_area cur_render_area = HALF_AREA; - /* Open connection to syslog */ - openlog(NULL, LOG_PID, LOG_USER); - /* Set up VDO */ settings = vdo_map_new(); vdo_map_set_uint32(settings, "format", VDO_FORMAT_YUV); diff --git a/vdostream/app/vdoencodeclient.c b/vdostream/app/vdoencodeclient.c index ed4a69f7..0fc693b4 100644 --- a/vdostream/app/vdoencodeclient.c +++ b/vdostream/app/vdoencodeclient.c @@ -150,8 +150,6 @@ int main(int argc, char* argv[]) { gchar* output_file = "/dev/null"; FILE* dest_f = NULL; - openlog(NULL, LOG_PID, LOG_USER); - GOptionEntry options[] = { {"format", 't', diff --git a/web-server-using-fastcgi/app/fastcgi_example.c b/web-server-using-fastcgi/app/fastcgi_example.c index e3546c0e..2fc9a937 100644 --- a/web-server-using-fastcgi/app/fastcgi_example.c +++ b/web-server-using-fastcgi/app/fastcgi_example.c @@ -37,7 +37,6 @@ static int fcgi_run(void) { char* socket_path = NULL; int status; - openlog(NULL, LOG_PID, LOG_DAEMON); socket_path = getenv(FCGI_SOCKET_NAME); if (!socket_path) {