Back out 10498 and 10097
[catagits/Catalyst-Runtime.git] / t / unit_core_setup_log.t
index ce4d58e..401ea99 100644 (file)
@@ -8,7 +8,7 @@ use Catalyst ();
 
 sub mock_app {
     my $name = shift;
-    warn("Setting up mock application: $name\n");
+    print "Setting up mock application: $name\n";
     my $meta = Moose->init_meta( for_class => $name );
     $meta->superclasses('Catalyst');
     return $meta->name;
@@ -34,9 +34,7 @@ local %ENV; # Ensure blank or someone, somewhere will fail..
     $app->setup_log('error,warn');
     ok !$app->debug, 'Not in debug mode';
     test_log_object($app->log,
-        fatal => 0, # WTF - I thought log levels were additive these days,
-                    # or do I not understand the patch which pupported to make
-                    # them so?
+        fatal => 1,
         error => 1,
         warn => 1,
         info => 0,
@@ -49,10 +47,10 @@ local %ENV; # Ensure blank or someone, somewhere will fail..
     $app->setup_log('');
     ok $app->debug, 'In debug mode';
     test_log_object($app->log,
-        fatal => 0,
-        error => 0,
-        warn => 0,
-        info => 0,
+        fatal => 1,
+        error => 1,
+        warn => 1,
+        info => 1,
         debug => 1,
     );
 }
@@ -62,8 +60,8 @@ local %ENV; # Ensure blank or someone, somewhere will fail..
     $app->setup_log('warn');
     ok !$app->debug, 'Not In debug mode';
     test_log_object($app->log,
-        fatal => 0,
-        error => 0,
+        fatal => 1,
+        error => 1,
         warn => 1,
         info => 0,
         debug => 0,
@@ -73,12 +71,13 @@ local %ENV; # Ensure blank or someone, somewhere will fail..
     my $app = mock_app('TestLogAppEmptyString');
     $app->setup_log('');
     ok !$app->debug, 'Not In debug mode';
+    # Note that by default, you get _all_ the log levels turned on
     test_log_object($app->log,
-        fatal => 0,
-        error => 0,
-        warn => 0,
-        info => 0,
-        debug => 0,
+        fatal => 1,
+        error => 1,
+        warn => 1,
+        info => 1,
+        debug => 1,
     );
 }
 {
@@ -86,10 +85,10 @@ local %ENV; # Ensure blank or someone, somewhere will fail..
     $app->setup_log('debug');
     ok $app->debug, 'In debug mode';
     test_log_object($app->log,
-        fatal => 0,
-        error => 0,
-        warn => 0,
-        info => 0,
+        fatal => 1,
+        error => 1,
+        warn => 1,
+        info => 1,
         debug => 1,
     );
 }