1

Topic: Log file: time format

greetings guys,

im currently developing a new stats tool (i dont like the available ones) and am wondering what format the time has or if i can change that format to some other format.

thx in advance

//bocki

2 (edited by CyaNox 2008-10-23 13:52:58)

Re: Log file: time format

It is a hexadecimal representation of a unix timestamp.

Should be quite trivial to convert.

(In PHP its something as simple as <?php echo date('r', hexdec('48f3cfc8'));?>)

There are 10 kinds of people ... those who understand binary and those who don't.

3

Re: Log file: time format

Easy to parse and/or compact I presume, but it would increase user friendliness with a (normal) human readable format imho.

4

Re: Log file: time format

Moriarty wrote:

Easy to parse and/or compact I presume, but it would increase user friendliness with a (normal) human readable format imho.

Yes, but frankly, do you sit staring at the logs yourself? I know I don't, and the best reason for them to be there as I see it is for scripts, and for that the format is great.

Used to be very active waay back

5

Re: Log file: time format

Well, I do not fill my days staring at teeworlds logs, no. But I do write programs myself and I cannot see why a log should not be easily human readable. They can still be parsed. I mean, the logs are there for viewing in the first place and can for sure be of help while debugging and/or understanding. Even for non-developers.

But as I stated first, that's my personal opinion and I can live with the current format. If I one day get heavily dependent upon knowing what time certain log messages in teeworlds are printed, I'd write a tool myself if someone hasn't. wink

6

Re: Log file: time format

In my opinion keeping the logs as raw as possible saves CPU time, because the game dont have to compute that much stuff.

We will meet again when the flowers spread their glorious scent of victory and the birds sing us the melody of justice...

7 (edited by Magnet 2008-10-23 19:12:26)

Re: Log file: time format

torch wrote:

In my opinion keeping the logs as raw as possible saves CPU time, because the game dont have to compute that much stuff.

You do realize that formatting a timestamp is insignificant with respect to CPU time(?)

8

Re: Log file: time format

No i dont. ( Explain if u wish, im all ears ... ) Also I was speaking about logging in general, not only about timestamps.

We will meet again when the flowers spread their glorious scent of victory and the birds sing us the melody of justice...

9

Re: Log file: time format

torch wrote:

No i dont. ( Explain if u wish, im all ears ... ) Also I was speaking about logging in general, not only about timestamps.

To put it simply, formatting log output whether it's the timestamps or more formatting is less cpu-intensive than about everything else TeeWorlds does. It already formats them and Bocki is asking for an alternative formatting; I personally don't really care but CPU time is really not an argument. This is only an aesthetical matter. The best thing would be to be able to configure the log output by having each admin defining the format they like, but even if this is not difficult to do that's hardly high on TW's priority list right now.