{"id":29080796,"url":"https://github.com/tomosfps/eclipse","last_synced_at":"2025-06-27T18:30:30.125Z","repository":{"id":300387095,"uuid":"1006055385","full_name":"tomosfps/eclipse","owner":"tomosfps","description":"Minimal C++ Logger designed to be used across multiple projects","archived":false,"fork":false,"pushed_at":"2025-06-21T12:03:32.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-21T12:21:42.869Z","etag":null,"topics":["cpp17","logger","logger-cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomosfps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-21T11:47:12.000Z","updated_at":"2025-06-21T12:03:35.000Z","dependencies_parsed_at":"2025-06-21T12:21:48.629Z","dependency_job_id":"15336feb-7216-4a34-92a7-3afb5a87e9dc","html_url":"https://github.com/tomosfps/eclipse","commit_stats":null,"previous_names":["tomosfps/eclipse"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomosfps/eclipse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomosfps%2Feclipse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomosfps%2Feclipse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomosfps%2Feclipse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomosfps%2Feclipse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomosfps","download_url":"https://codeload.github.com/tomosfps/eclipse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomosfps%2Feclipse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262310499,"owners_count":23291567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","logger","logger-cpp"],"created_at":"2025-06-27T18:30:25.348Z","updated_at":"2025-06-27T18:30:30.100Z","avatar_url":"https://github.com/tomosfps.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eclipse\n\nA minimal, colorful C++ logging library designed for use across multiple projects. Eclipse provides clean, structured log output with colored formatting, timestamps, and trace information to help you debug and monitor your applications effectively.\n\n\u003e [!CAUTION]\n\u003e Your terminal will need to support UTF8, otherwise some characters may not work.\n\n## Features\n\nEclipse is a lightweight logging solution that offers:\n\n- **Multiple Log Levels**: DEBUG, INFO, WARNING, ERROR with configurable filtering\n- **Colored Output**: Different colors for each log level for better readability\n- **Timestamps**: Automatic timestamp generation for each log entry\n- **Trace Information**: File, line, and function information for debugging\n- **Environment Configuration**: Set log levels via `.env` file\n- **Singleton Pattern**: Global access without repeated instantiation\n- **Cross-Platform**: Works on Windows, Linux, and macOS\n\n## Features \n___\n\n- [x] Colored output for different log levels\n- [x] Timestamp generation\n- [x] Environment variable configuration\n- [x] Trace information (file, line, function)\n- [x] Singleton pattern for global access\n- [x] Thread-safe logging\n\n## Build\n\nIf you'd like to build the project yourself, you'll need CMake and a C++17 compatible compiler:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/tomosfps/eclipse.git\n   cd eclipse\n   ```\n\n2. Create a build directory:\n   ```bash\n   mkdir build\n   cd build\n   ```\n\n3. Configure the project:\n   ```bash\n   # Basic configuration (Debug is default)\n   cmake ..\n   \n   # Specify build type:\n   cmake -DCMAKE_BUILD_TYPE=Debug ..         # Debug build with symbols\n   cmake -DCMAKE_BUILD_TYPE=Release ..       # Optimized release build\n   cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. # Release with debug symbols\n   cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..    # Size-optimized release\n   \n   # Additional options:\n   cmake -DBUILD_TESTS=OFF ..               # Disable tests\n   cmake -DCMAKE_INSTALL_PREFIX=/custom/path .. # Custom install location\n   ```\n\n4. Build the library:\n   ```bash\n   cmake --build .\n   ```\n\n### Global Installation\n\nTo install Eclipse globally for use in other projects:\n\n1. Complete the build steps above\n\n2. Install the library:\n\n    - **On Linux/macOS:**\n      ```bash\n      sudo cmake --install .\n      ```\n\n    - **On Windows (from the build directory):**\n      ```powershell\n      cmake --install . --config Release\n      ```\n      \u003e **Note:** You may need to run your terminal as Administrator if installing to a system location.\n\n3. In your project's `CMakeLists.txt`:\n   ```cmake\n   cmake_minimum_required(VERSION 3.15)\n   project(YourProject)\n\n   find_package(Eclipse REQUIRED)\n\n   add_executable(${PROJECT_NAME} main.cpp)\n   target_link_libraries(${PROJECT_NAME} PRIVATE Eclipse::EclipseCore)\n   ```\n\n## Usage\n\n### Basic Usage with Macros (Recommended)\n\nThe easiest way to use Eclipse is through the provided macros:\n\n```cpp\n#include \u003cEclipse/LogMacros.h\u003e\n\nint main() {\n    LOG_INFO(\"APP\", \"Application started successfully\");\n    LOG_WARNING(\"CONFIG\", \"Using default configuration\");\n    LOG_ERROR(\"DATABASE\", \"Failed to connect to database\");\n    LOG_DEBUG(\"NETWORK\", \"Sending HTTP request\");\n    LOG_INFO_DETAILS(\"USER\", \"User logged in\", \"Username: john_doe\");\n    LOG_ERROR_DETAILS(\"AUTH\", \"Authentication failed\", \"Invalid credentials provided\");\n    \n    return 0;\n}\n```\n\n### Direct Logger Usage\n\nYou can also use the Logger class directly:\n\n```cpp\n#include \u003cEclipse/Logger.h\u003e\n\nint main() {\n    Logger\u0026 logger = Logger::getInstance();\n    \n    // Set log level (optional, default is INFO)\n    logger.setLogLevel(LogLevel::DEBUG);\n    \n    // Note: Direct usage requires implementing the friend functions\n    // or using the macro interface shown above\n    \n    return 0;\n}\n```\n\n### Environment Configuration\n\nCreate a `.env` file in your project root to configure the log level:\n\n```env\nLOG_LEVEL=DEBUG\n```\n\nSupported values:\n- `DEBUG` or `0` - Show all messages\n- `INFO` or `1` - Show info, warning, and error messages (default)\n- `WARNING` or `2` - Show warning and error messages only\n- `ERROR` or `3` - Show error messages only\n\n### Log Output Format\n\nEclipse produces clean, structured output like this:\n\n```\n[2025-06-21 14:30:15] info: ┏ [APP] Application started successfully\n  ┃ at main.cpp:10 [main]\n\n[2025-06-21 14:30:15] warn: ┏ [CONFIG] Using default configuration  \n  ┃ at main.cpp:11 [main]\n\n[2025-06-21 14:30:15] error: ┏ [AUTH] Authentication failed\n  ┃ at auth.cpp:25 [authenticate]\n  ┗ [1] Invalid credentials provided\n```\n\n## Available Log Levels\n\n| Level   | Color | Description |\n|---------|-------|-------------|\n| DEBUG   | Cyan  | Detailed debugging information |\n| INFO    | Green | General information messages |\n| WARNING | Yellow| Warning messages for potential issues |\n| ERROR   | Red   | Error messages for serious problems |\n\n## Integration Examples\n\n### Simple Application\n\n```cpp\n#include \u003cEclipse/LogMacros.h\u003e\n\nint main() {\n    LOG_INFO(\"STARTUP\", \"Initializing application\");\n    \n    try {\n        // Your application logic\n        LOG_DEBUG(\"LOGIC\", \"Processing data\");\n    } catch (const std::exception\u0026 e) {\n        LOG_ERROR_DETAILS(\"EXCEPTION\", \"Unhandled exception\", e.what());\n        return 1;\n    }\n    \n    LOG_INFO(\"SHUTDOWN\", \"Application finished successfully\");\n    return 0;\n}\n```\n\n### Multiple Files\n\n**main.cpp**\n```cpp\n#include \u003cEclipse/LogMacros.h\u003e\n#include \"utils.h\"\n\nint main() {\n    LOG_INFO(\"MAIN\", \"Starting application\");\n    processData();\n    LOG_INFO(\"MAIN\", \"Application completed\");\n    return 0;\n}\n```\n\n**utils.h**\n```cpp\n#pragma once\nvoid processData();\n```\n\n**utils.cpp**\n```cpp\n#include \"utils.h\"\n#include \u003cEclipse/LogMacros.h\u003e\n\nvoid processData() {\n    LOG_DEBUG(\"UTILS\", \"Processing data started\");\n    // Your processing logic here\n    LOG_DEBUG(\"UTILS\", \"Processing data completed\");\n}\n```\n\n## Requirements\n\n- C++17 compatible compiler\n- CMake 3.15 or higher\n- Standard C++ library\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomosfps%2Feclipse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomosfps%2Feclipse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomosfps%2Feclipse/lists"}