Results 1 to 3 of 3
Hello,
I am writing some code right now and I am thinking it would be grate to create some log file and send to it error/warning messages. Is there any ...
- 10-15-2007 #1Just Joined!
- Join Date
- Jun 2006
- Location
- Krakow, Poland
- Posts
- 5
create and use log file with C
Hello,
I am writing some code right now and I am thinking it would be grate to create some log file and send to it error/warning messages. Is there any common pattern to implement this solution? How can I easily get log directory name, create this file and send messages from C??
- 10-15-2007 #2
I don't know what you mean by "get log directory name", but for your other questions, do this at the command line:
and all will be revealed.Code:man fopen man fwrite
- 10-15-2007 #3
If you just want to print warnings or errors to the user, you can just print to stderr and let him redirect it as he pleases.
If you want to use a system logfile, you can use the syslog() function. Run the command "man 3 syslog" for more information.DISTRO=Arch
Registered Linux User #388732


Reply With Quote