blapid / llcpp Goto Github PK
View Code? Open in Web Editor NEWLiteral Logging for C++
License: MIT License
Literal Logging for C++
License: MIT License
Very nice idea. I know you want to prove your point of faster "binary logging". But I think this extension fits much better here than any other logging framework.
As background: I ran into the issue that at positions where errors occur the context that lead to this issue is out of focus.
For example I migrate multiple databases and multiple tables. But a column data type does not match to the current database provider. But when I tell the user "yeah this data type does not work" he needs the context which column, which table and which database the error refers to.
The idea is, that I store context information to the log, but those are only written once a log message is written.
The "very stylized" usage might look like this:
void migrate_database(auto database) {
logger.context("migrating database %s", database.name);
for (auto table : database.tables) migrate_table(table);
}
void migrate_table(auto table) {
logger.context("migrating table %s", table.name);
for (auto column : table.columns) migrate_column(column);
}
void migrate_column(auto column) {
logger.context("column %s", column.name);
auto sql_type = to_sql_type(column.type);
}
auto to_sql_type(auto type) {
// … else
logger.error("wrong sql type");
}
The log may look something like this:
error: wrong sql type
context: column xyz, migrating table users, migrating database example
Or the context is only set once
context: migrating database example
context: > migrating table users
context: > > column xyz
error: wrong sql type
context: > > column abc
error: wrong sql type
context: > migrating table products
context: > > column price
context: wrong sql type
I hope you get what I mean. What do you think?
Any plan in providing CMake, conan and/or vcpkg integration ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.