The general advice I got was that if the loan interest rate is less than 6%, you're better off investing the majority of your excess cash into something like an index fund since it theoretically will give you >6% gains.
However, I hate the stress, mental overhead, and risk involved in owing somebody money, so I decided to automatically save 10% of each paycheck (set up direct deposit to funnel 10% to a separate savings/investment account) and essentially contribute as much as possible after that to student loans.
I'm happy where I currently am - almost out of debt and with a non-trivial amount saved up. The key for me was automatically moving the first 10% to savings then setting an ambitious goal each month to put toward debt. Good luck!