Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, In programming, how to write error messages. I dont want to use printf's in all the threads as it is blocking function. What is the general way of logging ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    28

    logging error messages

    Hi,

    In programming, how to write error messages. I dont want to use printf's in all the threads as it is blocking function.

    What is the general way of logging messages. It will be of great help if you suggest me some good documentation.

    Thanks in advance

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Depends on the program, really, if it's an interactive one then outputting to stderr is appropriate, if it's a daemon then logging to a file is the way to go. If you're in a blocking thread, dump the message in shared memory and signal a message-handling thread to go handle it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...