🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #1485

Re: Printf: vaste lengte strings en ints?

#1485
From: Philip Paeps
Date: Tue, 01 Mar 2005 09:38
18 lines
1784 bytes
In be.comp.programming Aquila <braempje@netscape.net> wrote:
> In een stukje logging code gebruik ik volgend commando:
> sprintf(buffer, "%s %.9f _%i_ --- %i %i ------- [%i:%i] (%s) %s", event,
> timeval2double(now), id, pid, length, nid, dst_i, message, additional)

Is het niet handiger om gewoon syslog(3) te gebruiken?  Dan zorgt syslogd(8)
voor het formatten van messages op een fairly standaard manier, en moet je je
enkel nog zorgen maken over je message zelf, niet over hoe laat het is, of
waar het vandaan komt.

 - Philip

-- 
Philip Paeps                              Please don't email any replies
philip@paeps.cx                               I follow the newsgroup.

  The secret of success is sincerity.  Once you can fake
  that you've got it made.
Technical Details
Message-ID: <42243809$0$28991$e4fe514c@news.xs4all.nl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!130.161.131.117.MISMATCH!tudelft.nl!newsfeed.multikabel.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!transit.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
References: <M5qdnYvpZutbs7nfRVnyjA@scarlet.biz>

Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,f962124bbb04ff22
X-Google-Attributes: gidfcea4,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!130.161.131.117.MISMATCH!tudelft.nl!newsfeed.multikabel.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!transit.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Sender: Philip Paeps <philip@loge.nixsys.be>
Message-ID: <42243809$0$28991$e4fe514c@news.xs4all.nl>
From: Philip Paeps <philip+usenet@paeps.cx>
Subject: Re: Printf: vaste lengte strings en ints?
Newsgroups: be.comp.programming
References: <M5qdnYvpZutbs7nfRVnyjA@scarlet.biz>
Organization: Happily Disorganized
User-Agent: tin/1.7.8-20050217 ("Scalpay") (UNIX) (FreeBSD/6.0-CURRENT (i386))
Date: 01 Mar 2005 09:38:17 GMT
Lines: 18
NNTP-Posting-Host: 195.144.64.15
X-Trace: 1109669897 news.xs4all.nl 28991 [::ffff:195.144.64.15]:54765
X-Complaints-To: abuse@xs4all.nl