How can I get access to the name of an environment from within its own definition?

Consider, e.g.:

\newenvironment{test}{This is som text from environment \printname :}{}

I would like \printname to give the name of the environment, such that I get the following output:

enter image description here

Browse other questions tagged or ask your own question.