levels: add string helper
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..66be63a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+logrus
diff --git a/logrus.go b/logrus.go
index f41e1a4..79df39c 100644
--- a/logrus.go
+++ b/logrus.go
@@ -10,6 +10,26 @@
 // Level type
 type Level uint8
 
+// Convert the Level to a string. E.g. PanicLevel becomes "panic".
+func (level Level) String() string {
+	switch level {
+	case DebugLevel:
+		return "debug"
+	case InfoLevel:
+		return "info"
+	case WarnLevel:
+		return "warning"
+	case ErrorLevel:
+		return "error"
+	case FatalLevel:
+		return "fatal"
+	case PanicLevel:
+		return "panic"
+	}
+
+	return "unknown"
+}
+
 // These are the different logging levels. You can set the logging level to log
 // on your instance of logger, obtained with `logrus.New()`.
 const (
diff --git a/logrus_test.go b/logrus_test.go
index 82187ae..f14445c 100644
--- a/logrus_test.go
+++ b/logrus_test.go
@@ -128,3 +128,12 @@
 	assert.Equal(t, false, ok)
 	assert.Equal(t, "value1", fields["key1"])
 }
+
+func TestConvertLevelToString(t *testing.T) {
+	assert.Equal(t, "debug", DebugLevel.String())
+	assert.Equal(t, "info", InfoLevel.String())
+	assert.Equal(t, "warning", WarnLevel.String())
+	assert.Equal(t, "error", ErrorLevel.String())
+	assert.Equal(t, "fatal", FatalLevel.String())
+	assert.Equal(t, "panic", PanicLevel.String())
+}