There are two sections to the attack line, a name, and then the stats. I’m going to format the name in bold and the stats in italics:
longsword +5 (1d8+2/19-20)
Thus, the name of the weapon – which weapon it actually is – is just “longsword.” As in the generic, unmodified, non-masterwork, non-magic longsword (stats in the “One-handed Martial Melee” weapons table).
The stats, by the way, are attack (+5), damage (1d8+2), and critical (19-20, the range; a multiplier of ×2 is implied). These stats are all totals, after all factors are applied, so that DMs can just use them as-is, without having to hunt down other relevant stats (and possibly miss something like a relevant Weapon Focus feat).
the +5 attack comes from a combination of BAB, Strength, and possibly something like Weapon Focus
the damage comes from the weapon itself (1d8) plus other bonuses like Strength
the critical stats are from the weapon, but can be modified by e.g. Improved Critical.
If you were dealing with a magical weapon, say a +1 defending longsword, the statblock would instead say:
+1 defending longsword +6 (1d8+3/19-20)
Note that the name is still bolded, it’s simply also italicized to be consistent with the formatting used by the books for magic items. Note how the +5 attack bonus is now +6 (because of the +1 enhancement bonus), and the damage is 1d8+3 (again, +1 enhancement bonus).