{"id":16166063,"url":"https://github.com/zjeffer/qtconsolelogger","last_synced_at":"2026-04-28T18:34:50.593Z","repository":{"id":111065914,"uuid":"514686217","full_name":"zjeffer/QtConsoleLogger","owner":"zjeffer","description":"Qt Widget that uses a g3log sink to display log messages to the user","archived":false,"fork":false,"pushed_at":"2022-08-30T13:15:56.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T09:46:21.797Z","etag":null,"topics":["cpp","g3log","qt","qt6","qtcreator","widget"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zjeffer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-07-16T21:15:16.000Z","updated_at":"2022-08-17T16:05:55.000Z","dependencies_parsed_at":"2023-04-14T07:57:14.320Z","dependency_job_id":null,"html_url":"https://github.com/zjeffer/QtConsoleLogger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjeffer%2FQtConsoleLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjeffer%2FQtConsoleLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjeffer%2FQtConsoleLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjeffer%2FQtConsoleLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zjeffer","download_url":"https://codeload.github.com/zjeffer/QtConsoleLogger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247598688,"owners_count":20964508,"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":["cpp","g3log","qt","qt6","qtcreator","widget"],"created_at":"2024-10-10T02:53:16.199Z","updated_at":"2026-04-28T18:34:45.568Z","avatar_url":"https://github.com/zjeffer.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QtConsoleLogger\n\nThis is an example project for a Qt Console widget that receives log messages from [g3log](https://github.com/KjellKod/g3log). \n\nI created a custom g3log sink that sends the logs to the widget. The widget itself (console.hpp \u0026 console.cpp) was copied from [here](https://code.qt.io/cgit/qt/qtserialport.git/tree/examples/serialport/terminal) and adapted for use with g3log.\n\n## Basic usage\n\nThe main method:\n\n```c++\nint main(int argc, char** argv) {\n\t// create an application\n\tQApplication a(argc, argv);\n\t// create a window:\n\tMainWindow window = MainWindow();\n\twindow.show();\n\n\t// start running \n\treturn a.exec();\n}\n\n```\n\nInside your custom window constructor:\n\n```c++\nMainWindow::MainWindow(QWidget *parent) :\n    QMainWindow{parent}, \n    m_Ui(new Ui::MainWindow) \n{\n\t// create a logger\n\tLogger logger = std::make_unique\u003cLogger\u003e(this);\n\n\t// Create a new Console object\n\tConsole console = Console();\n\n\t// you can also create the logger in the constructor's initializer list,\n\t// but I'm doing it like this to make it easier to understand.\n\n\t// place the console where you want, for example as the central widget:\n\tsetCentralWidget(\u0026console);\n\n\t// connect the getData signal to the putData method\n\tconnect(m_Console, \u0026Console::getData, m_Console, \u0026Console::putData);\n\n\t// Every time you use g3log's LOG(\u003cLEVEL\u003e) macro, \n\t// it will print the message to both stdout and the GUI console:\n\tLOG(INFO) \u003c\u003c \"Example\";\n}\n```\n\nFor a full example on how to create a window with a console, see [src/mainwindow.cpp](src/mainwindow.cpp), [src/mainwindow.hpp](src/mainwindow.hpp), and [src/main.cpp](src/main.cpp).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjeffer%2Fqtconsolelogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzjeffer%2Fqtconsolelogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjeffer%2Fqtconsolelogger/lists"}