Adding Custom Image To Header Via New Customizer Setting

First part of your code looks correct – it’s hard to say if it will work, because it’s only part of it, but there is nothing wrong with the part you’ve shown.

Problem lies in this line:

<?php swag_header_logo(); ?>

You haven’t defined such function anywhere in your code, so you can’t call it – and that’s what the error is saying (“Call to undefined function swag_header_logo()”).

So how to fix it?

In this line:

$swag_header_logo = get_theme_mod('swag_header_logo');

you get the ID of attachment set as swag_header_logo and you store this ID in $swag_header_logo variable.

So if you want to display the image, just use:

echo wp_get_attachment_image( $swag_header_logo, '<SIZE>' ); // change size to real value

or if you want only the URL of the image:

echo wp_get_attachment_image_url( $swag_header_logo, '<SIZE>' ); // change size to real value