Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

transcrimee/Logging-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logging Library For C

Logging Library is a lightweight, open-source logging utility designed to eliminate the complexity.


✨ Key Features

  • Enhanced Readability: I found default method hard so made this more easy to read logging(LOG_INFO, "test"); or use systemlog to log system info systemlog(LOG_SYSTEM); .
  • Reduced Complexity: Avoid jargon and use clear, direct words to ensure understanding.
  • Lightweight Design: Focuses only on essential logging without unnecessary bloat.
  • Open Source: Fully transparent and community-driven under the BSD-3-Clause license.

🚀 Quick Start

To integrate Stylelibrary into your project, use the following installation command:


# Example installation (Keep you git install)
git clone https://github.com/transcrimee/Logging-Library.git

Example Code


// Example usage of the logging library
#include <stdio.h>
#include "logging.h"

int main() {
    int age; // Declare an integer variable to store the age

    // Prompt the user for input
    printf("Enter your age: ");
 
    // Read the integer input from the user and store it in the 'age' variable
    scanf("%d", &age);

    // Use an if statement to check the condition
    if (age >= 18) {
        printf("You are eligible to vote.\\n");
        logging(LOG_INFO, "User is eligible to vote.");

    } else {
        printf("You are not eligible to vote yet.\\n");
        logging(LOG_INFO, "User is not eligible to vote.");
    }

    return 0;
}

// Example usage of systemlog to log system information
#include <stdio.h>
#include <string.h> // Required for strcmp()
#include "logging.h"

int main() {
    char answer[10]; // Buffer to store the input (e.g., 10 characters)

    printf("Do want log your system Enter 'yes' or 'no': ");
    scanf("%s", answer); // Read the string

    // strcmp returns 0 if the strings are identical
    if (strcmp(answer, "yes") == 0) {
        printf("You entered yes. your has been log\n");
        systemlog(LOG_SYSTEM);
    } else if (strcmp(answer, "no") == 0) {
        printf("You entered no.\n"):
    } else {
        printf("Invalid input.\n");
    }

    return

About

Logging Library is a lightweight, open-source logging utility designed to eliminate the complexity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages