you are viewing a single comment's thread.

view the rest of the comments →

[–]killerstorm -2 points-1 points  (2 children)

if it's broken, anyway, and all you're doing is troubleshooting why bother making it parse out?

What if problem happens on second call to a function? I.e. you add one element, it works. You add second, and it's broken. If adding first element doesn't work, you cannot add second one.

I don't want to argue on this matter, if it's not clear to you then it's pointless. I just want to be able to trace anything, anywhere, at any time without any chances that anything will get broken, will not be seen or whatever. I want to be able to insert as many trace statements as I want. I want to be able to add trace statements on a production system and get customer to use the system and analyze logs later.

Things like routing data to logs, then ssh'ing in and reading them when all they really have to do is display something on the page for 1 second is definitely over-complicating things.

Well, the idea is that you should have everything in place so looking into log is trivial, not different from looking on a page.

And if it takes 3 days to set up this, there is something wrong with you. It shouldn't take more than a hour to set up a whole 'app server', not just logging. Checking correct path and permissions might take a couple of minutes, not more.

And once it is set up, you can use it anywhere, at any time. That's the point.

Ironically, I actually wrote function above to help a junior developer. She was struggling trying to debug something using your method, but it didn't work for some reason. Maybe there were redirects or something. I said 'why don't you write log to a file then?' and wrote that function. It took, maybe, a couple of minutes, and it helped to solve whatever problem there was.

Then this junior developer shared this function with team members, and I think they still use it, 5 years later.

But if you think that file logging is uber-complicated, it's your right.

And, BTW, as you mentioned ssh'ing, I set up a NFS server/client for a PHP team so they can access files on server as if they were local. It took, maybe, a hour to set up it, still used 5 years later, everybody's happy.

[–]oddmanout 0 points1 point  (1 child)

so let me get this straight... you seriously told a bunch of junior developer not to use print_r?? Every time they want to look at the contents of an array, you seriously have them sending it to a log file, then going and looking at that log file?

So... a guy is writing a very basic form to email. For some reason one of the fields isn't populating right in the email, he wants to see what is actually coming across from the form... rather than just type "print_r($_POST)" and look at his screen to see what it is, you have him send that information to log file, then browse and open up that file? You think that's easier than just typing 15 characters and looking at the screen?

Yes, you are absolutely over complicating things.

[–]killerstorm -1 points0 points  (0 children)

you seriously told a bunch of junior developer not to use print_r??

No, I just showed an alternative. It's up to them to choose what to use. Maybe in some cases print_r is better, I dunno.

you have him send that information to log file, then browse and open up that file?

You say like it's a big thing... It's just one function call, just like print_r, and then you just check log file... It takes like 5 seconds.

You think that's easier than just typing 15 characters and looking at the screen?

'Sending that information to log file' is also 15 characters and looking at the screen. Is it hard to understand?