I would err towards investing, but it depends.
You should calculate your post tax return both on your investments and debts. You have to pay taxes on your investments, and you may be able to deduct interest on some of your debt. This may lower the effective APR on both.
For example, using big round numbers for the sake of ease - let’s say you earn 10% on your investment. Let’s say you’re solidly into the 28% tax bracket and that your investment return will be taxed as ordinary income, such that the entirety of your 10% investment sees the same tax rate of 28%. Your 10% return is now a 7.2% return adjusted for tax.
Your 6% student loan may or may not be eligible for interest deduction. For the sake of argument, let’s assume it is not eligible. You need a pre-tax return of 8.3% on your investment to get a tax adjusted return of 6% (lower if you can deduct interest).
FWIW - investing is not without risk, not only from the perspective of poor returns, but also loss of principle. Investing in peer-to-peer lending for example (which I personally like to do), risks not just a lower than expected return, but potentially the loss of all of your initial capital. This risk does not exist with paying down debt.