Per Jessen schreef op 10-04-16 10:19:
The difference is they call him king, the difference frightens me.
What I mean is very simple, and you already know the answer.
1. Anything you write yourself you will have to write from scratch if you cannot reuse someone else's code. 2. This will take a lot of energy and is less efficient than reusing existing code if you agree with that code.
In principle this is absolutely true, in practice for a write2log() call, less so. Unless that call was part of a framework I wanted to use in my application anyway, I would not bother. It would take me less time to write my own than to learn how to use a foreign one.
Probably, but that depends on how complex those other ones are, and whether you can use it with a few simple command calls. For instance "logger" is clearly not a complex tool. If it had a little more functionality, the same interface would be very easy to use in a script (or program).
You DO understand why libraries exist in the first place right? So not everyone has to constantly reinvent the wheel. I mean are you just purposefully being thick here? I mean pretending not to understand so you won't have to reach a certain conclusion? So no, the difference is not packaging, the difference is effort required to reach a certain level of functionality. That's WHY you use existing libraries.
Would you like to be a little less condescending?
Most of what you write is condescending to begin with. And I apologized for the word thick, I just don't know how to express it.
Now if those libraries don't exist, you have a problem. A certain feature in the system ecosystem is missing.
If they don't exist, you have no option but to write them yourself. I don't see a problem here.
The question was whether they exist. Logrotation and asynchronous writing and all of that is not that easy to implement. Sure, if you spend a few hours to a few days on it, sure you might have something. The whole purpose of me asking was to help the OP (and myself) to see if something might not be missing here. If every application writes its own logging framework, that's a lot of wasted effort. Apparently you want me to start exploring the source of e.g. squid to see how it does it. I would think people would know about these answers.
And if existing syslogd and logrotate do not fit your purposes, then what?
1) invent your own wheel or, 2) change your purpose to suit the wheels at hand
Yes, you're being thick. The question was clearly intended to find a solution that did agree with the purpose. Changing your purpose is like changing the question and reason for asking, and as such it means not getting an answer. Writing it yourself means spending an amount of time you were trying to avoid to see if something else did not already exist. I mean you don't have to answer questions you don't understand by assuming or insinuating that the person asking the question is somehow too stupid to come up with these answers himself. How do I view a webpage? 1. Write an operating system. 2. Write networking software. 3. Write a desktop GUI 4. Write a web browser Now you can view a webpage. (Facepalm). I KNOW that I could write any piece of missing functionality myself, if I had the time. I KNOW I can create my own logging framework and market or distribute it. If I had the time, the ability, the purpose, and the convenience. I KNOW that that would be a solution. But if a solution currently does not exist it is also because of people who cannot understand that anyone would want it. It's like there only being two kinds of apples on the market: very small ones, and very big ones. And then someone comes and says "why are there not any medium ones?" And people answer "Why do you need a medium one? You can just eat lots of small ones right? Or chop a big one in half?" This is the problem with most Linux people, they cannot conceive of anything new coming into being. When you say "why are there no medium apples?" they cannot understand why anyone would want a medium apple. When you say "why is there no logging framework?" they say "you can use the big one or the small one, right? Why do you have a need for a medium one?" Maybe "why" is a meaningless question, but I did not really ask that. I asked whether anything of the kind existed, and tried to explain the reasons why. "And if existing syslogd and logrotate do not fit your purposes, then what?" This question was clearly intended to open up the space where solutions could be found. Not a denial of any kind of answer with a collapse into non-creative "use what is available or do it yourself" answers. The whole point was to inquire into what more could be available. Such inquiries can transform into a creative approach, but you don't start designing your own meant-for-broader-use system either unless and until you have explored the existing landscape. You will first want to know if anyone else has done it, before you start doing it yourself, mostly. "Use what is available or do it yourself" is not the kind of answer that contains any information. The answer is so generic that it applies to everything, or rather, that it does not apply to anything. I was not asking for the well-traveled road, as we say in Dutch. I was curious whether something did actually not really exist. Then when you (Per) asked why I would even want it, I tried to explain.
Are there situations where a programmer could /use/ application-level logging functionality instead of system-wide features? Definitely. Why not?
That what I keep saying. It's called write(). see "man 2 write".
This is about as condescending as you can get without using explicit words for it. You really feel the need to tell someone about the most primitive system call to write text to a file???? Insulting people or someone by pretending, assuming or insinuating that person would not have been able to come up with that himself? This is what you do constantly Per. You give answers I do not need because apparently you do not understand that I am looking for something more. It is like saying "how can I write a thesis about global economies and their interrelationship?" and you say "grab a pen and paper". Clearly the person did not inquire into that sort of information. You are not doing that person a service okay. You also don't need to tell me what grep is or what a file redirect could be. You also don't need to tell me how to use a keyboard to write commands. I was asking for a certain kind of solution and whether it existed or not, and I expressed some incredulity that apparently in fact it doesn't -- or you people would probably know about it (but I can't be sure). I don't need to be told that I can change my purpose or write the thing I need from scratch. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org