Browse Source

Add Fatal logging option (#17363)

Add Fatal logging option
tags/v18.0.0beta1
John Molakvoæ 4 years ago
parent
commit
7d9a5036a2
No account linked to committer's email address
2 changed files with 8 additions and 2 deletions
  1. 6
    2
      core/Command/Log/Manage.php
  2. 2
    0
      tests/Core/Command/Log/ManageTest.php

+ 6
- 2
core/Command/Log/Manage.php View File

'level', 'level',
null, null,
InputOption::VALUE_REQUIRED, InputOption::VALUE_REQUIRED,
'set the log level [debug, info, warning, error]'
'set the log level [debug, info, warning, error, fatal]'
) )
->addOption( ->addOption(
'timezone', 'timezone',
case 'error': case 'error':
case 'err': case 'err':
return 3; return 3;
case 'fatal':
return 4;
} }
throw new \InvalidArgumentException('Invalid log level string'); throw new \InvalidArgumentException('Invalid log level string');
} }
return 'Warning'; return 'Warning';
case 3: case 3:
return 'Error'; return 'Error';
case 4:
return 'Fatal';
} }
throw new \InvalidArgumentException('Invalid log level number'); throw new \InvalidArgumentException('Invalid log level number');
} }
if ($optionName === 'backend') { if ($optionName === 'backend') {
return ['file', 'syslog', 'errorlog', 'systemd']; return ['file', 'syslog', 'errorlog', 'systemd'];
} else if ($optionName === 'level') { } else if ($optionName === 'level') {
return ['debug', 'info', 'warning', 'error'];
return ['debug', 'info', 'warning', 'error', 'fatal'];
} else if ($optionName === 'timezone') { } else if ($optionName === 'timezone') {
return \DateTimeZone::listIdentifiers(); return \DateTimeZone::listIdentifiers();
} }

+ 2
- 0
tests/Core/Command/Log/ManageTest.php View File

['wArn', 2], ['wArn', 2],
['error', 3], ['error', 3],
['eRr', 3], ['eRr', 3],
['fAtAl', 4],
]; ];
} }


[1, 'Info'], [1, 'Info'],
[2, 'Warning'], [2, 'Warning'],
[3, 'Error'], [3, 'Error'],
[4, 'Fatal'],
]; ];
} }



Loading…
Cancel
Save