Comments (8)
Hi!
Actually I tried to use it in the past and got the following results:
__FILE__
cases full file paths to be present in a binary (that is not desirable)- In most cases a function name gives more meaningful information than a file name
So I decided to drop __FILE__
in favor of __FUNC__
.
If you have any thoughts about this please share.
from plog.
Well, my needs are rather specific... i write a Python module based on some C++ library. I use plog for the C++ part, and i need to get the logs back to the standard Python logging system (so that the end user also has to care about Python).
Somewhere in the cooking i have to build a Python LogRecord object (https://docs.python.org/2/library/logging.html#logrecord-objects). This kind of object typically references the source filename.
("FILE cases full file paths to be present in a binary (that is not desirable)" -> definitely agree, thats why #line can be useful: https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html#Line-Control)
from plog.
#line
could help but it requires you to manually specify file names.
What if you just return an empty file name?
from plog.
well, then i don't have the C source filename in Python logs :) Right now i push FILE into Record void* 'object' field, but that doesnt feel "clean".
from plog.
Hey, take a look at the capture-file
branch. Will that work for you?
from plog.
Sure, thanks !
(I do think that to provide FILE it's not possible to only work by inheritance, as a custom LogRecord class is not really possible for the user)
from plog.
@stephane-martin How is it going?
from plog.
Merged to master.
from plog.
Related Issues (20)
- Function argument for use with plog HOT 2
- How can I dynamically create a Logger object? HOT 4
- always printf null HOT 2
- Roll log on application start HOT 2
- Log a packed argument list HOT 2
- Debug version using printf style alway cause Debug Assertion Failed! HOT 2
- Static linking of library HOT 2
- Release 1.1.10? HOT 6
- [Bug] When creating and assigning to logger - Compiler givers error: HOT 4
- [Feature Request] Single logger, but each appender has a different level HOT 4
- [Question] How to use Chained for multiple Classes within many DLL's
- \r\n for TxtFormatter in raw consoles HOT 4
- [Question] How to add custom prefix (record) information? HOT 2
- Can't add ConsoleAppender in a if statement HOT 2
- std::filesystem::path issue with new utf-8 mode on MSVC/Windows HOT 5
- Capture stdout and redirect to plog HOT 11
- How to use plog library in mac, its not working in mac for me HOT 5
- Please add instruction how to run samples HOT 3
- Features say doesnt require c++11 but code uses c++11 HOT 3
- Plog not initializing with too long of a file name? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plog.