375
you are viewing a single comment's thread
view the rest of the comments
[-] Tryptaminev@lemm.ee 5 points 1 year ago

Please excuse my ignorance, but what is grep, what are the do's and dont's of logging and why are people here talking about having an entire team maintain some pipeline just to handle logs?

[-] rodbiren@midwest.social 9 points 1 year ago

It's a command line tool which filters for all lines containing the query. So something like

cat log.txt | grep Error5

Would output only lines containing Error5

[-] porous_grey_matter@lemmy.ml 9 points 1 year ago

You can just do

grep Error5 log.txt
[-] biribiri11@lemmy.ml 12 points 1 year ago

In the back of my mind I know this is there, but the cat | grep pattern is just muscle memory at this point

[-] allywilson@lemmy.ml 3 points 1 year ago

I've been 'told off' so many times by the internet for my cat and grep combos that I still do it, then I remove the cat, it still works, and I feel better. shrug

[-] expr@programming.dev 3 points 1 year ago

Just remember that if you aren't actually concatenating files, cat is always unnecessary.

[-] MehBlah@lemmy.world 2 points 1 year ago

for me as well.

[-] MehBlah@lemmy.world 1 points 1 year ago

or if its a complex error cat log.txt|grep keyword1|grep keyword 2 and so on.

this post was submitted on 24 May 2024
375 points (100.0% liked)

Programmer Humor

37457 readers
7 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS