Browse Source

feat: add `--debug` option

master
dnomd343 2 years ago
parent
commit
b915854c09
  1. 2
      Dockerfile
  2. 4
      main.php
  3. 2
      src/Logger.php

2
Dockerfile

@ -34,4 +34,4 @@ RUN apk add --no-cache nginx php8 php8-fpm php8-iconv php8-pcntl
COPY --from=asset /asset/ / COPY --from=asset /asset/ /
EXPOSE 1688/tcp 1689/tcp EXPOSE 1688/tcp 1689/tcp
WORKDIR /kms-server/ WORKDIR /kms-server/
CMD ["php", "main.php"] ENTRYPOINT ["php", "main.php"]

4
main.php

@ -6,6 +6,10 @@ require_once './src/Daemon.php';
require_once './src/Logger.php'; require_once './src/Logger.php';
require_once './src/Process.php'; require_once './src/Process.php';
if (in_array('--debug', $argv)) { // debug mode
logging::$logLevel = logging::DEBUG;
}
$nginx = array( $nginx = array(
'name' => 'nginx', 'name' => 'nginx',
'command' => ['/usr/sbin/nginx'], 'command' => ['/usr/sbin/nginx'],

2
src/Logger.php

@ -1,6 +1,6 @@
<?php <?php
logging::$logLevel = logging::DEBUG; logging::$logLevel = logging::INFO; // default log level
$logColor = array( $logColor = array(
logging::DEBUG => '37m', // white logging::DEBUG => '37m', // white

Loading…
Cancel
Save