Template:USERNAME/doc

USERNAME displays the username of the user viewing the page.

If the user is not logged in, then the template will display. You can control the text displayed by adding a parameter to the template with a value of the default text. For example,  outputs "foo" if the user viewing it is not logged in.