Write a line to the cron log

@param string $sLine The line to write
764934
public function writeLog($sLine)
    {
        $this->oLogger->line(' [' . $this->sModuleName . '->' . $this->sMethod . '] ' . $sLine);
    }
1243561
public function write(string $level, string $message, array $context)
    {
        $this->logger->log($level, $message, $context);
    }
1272405
protected function writeOutputLine($msg, $min=0, $max=null)
    {
        if (!$this->shouldWriteOutput($min, $max)) {
            return;
        }

        $this->getOutput()->writeln($msg);
    }
845977
private function writeLine($text, $indent = 0)
    {
        $indent = strlen($text) + $indent;
        $format = '%'.$indent.'s';

        $this->reference .= sprintf($format, $text).PHP_EOL;
    }
231755
public static function log($msg, $mod = null, $file = 0, $line = 0)
    {
        self::logInfo($msg, $mod, $file, $line);
    }
72317
public static function add_line(string $log) : string {
        if (empty(self::$taskloginfo)) {
            return $log;
        }

        if (empty(self::$fh)) {
            return $log;
        }

        if (self::is_current_output_buffer()) {
            fwrite(self::$fh, $log);
        }

        return $log;
    }
670604
public function write($line)
    {
        return $this->pipes !== null ? fwrite($this->pipes[0], $line . PHP_EOL) : false;
    }
580496
protected function writeToLog($entry) {
		if ($entry[0] >= $this->logLevel) {
			trigger_error("** ".$this->getFormattedCaller()." ** {$entry[1]} **",$this->loggerTypes[$entry[0]]->getPhpErrorCode());
		}
	}
1076530
protected function writeLocale($locale, array $lines = [])
    {
        $translations = ConvertToTree::fromFlattened($lines);

        foreach ($translations as $section => $trans) {
            $this->filesystem->put(
                $locale.'/'.$section.'.php',
                "<?php\n\n return ".var_export($trans, true).";\n"
            );
        }
    }
1044718
private function startCron(Cron $cron)
    {
        if ($this->isLocked($cron)) {
            return;
        }

        $this->output->writeln(sprintf('Started %s.', $cron));
        $this->changeState($cron, Cron::STATE_RUNNING);

        $pb = $this->getCommandProcessBuilder();
        $parts = explode(' ', $cron->getCommand());
        foreach ($parts as $part) {
            $pb->add($part);
        }

        $process = $pb->getProcess();
        $process->setTimeout(3600);

        try {
            $process->mustRun();

            $this->output->writeln(' > '.$process->getOutput());

            if (!$process->isSuccessful()) {
                $this->output->writeln(' > '.$process->getErrorOutput());
                if(strpos($process->getErrorOutput(), 'timeout') !== false) {
                    $this->changeState($cron, Cron::STATE_TERMINATED, $process->getErrorOutput());
                } else {
                    $this->changeState($cron, Cron::STATE_FAILED, $process->getErrorOutput());
                }
            } else {
                $this->changeState($cron, Cron::STATE_FINISHED);
            }
        } catch (\Exception $e) {
            $message = $e->getMessage();

            if(strpos($e->getMessage(), 'timeout') !== false) {
                $this->output->writeln(' > '.$e->getMessage());
                $this->changeState($cron, Cron::STATE_TERMINATED, $e->getMessage());
            } else {
                $this->output->writeln(' > '.$e->getMessage());
                $this->changeState($cron, Cron::STATE_FAILED, $e->getMessage());
            }
        }
    }
238021
public function write_log($msg = '', $log_level = 0)
    {

        // log level check
        if ($this->log_level > (int)$log_level) return true;

        try {
            if (!$this->file->open((string)"$this->_log_path/$this->_file_name") && !$this->file->create_file("$this->_log_path/$this->_file_name")) {
                // $message = null, $code = null, $previous = null
                throw new LogException((string)"file: $this->_log_path/$this->_file_name couldn't be created.");
            }

            // check for the 2nd time
            $this->file->open("$this->_log_path/$this->_file_name");

            // if it doesn't exist add next line @ the end of the msg
            if (strpos($msg, "\n") === false) {
                $msg = "[" . (string)date(self::LOG_DATE_FORMAT) . (string)"] $msg " . "\n";
            } else {
                $msg = "[" . (string)date(self::LOG_DATE_FORMAT) . (string)"] $msg";
            }


            if ($this->file->append($msg) === false) {
                // some code
            }
            /*
             * while ( $this->file->append($msg) === false ) { /* // sleep 1
             * second sleep(1); if ( $start_time + 10 == time() ) { throw new
             * LogException("Sleep time for file:
             * $this->_log_path/$this->_file_name exceeded 10
             * seconds\n[msg]$msg"); break; } }
             */

        } catch (LogException $e) {
            error_log($e->getMessage());
        }

        return true;
    }
13755
function write( $string, $verbosityLevel = self::LEVEL_NOTICE, $label = "", $backgroundClass = "", $alwaysLog = false )
    {
        $enabled = eZDebug::isDebugEnabled();
        if ( !$alwaysLog and !$enabled )
            return;
        switch ( $verbosityLevel )
        {
            case self::LEVEL_NOTICE:
            case self::LEVEL_WARNING:
            case self::LEVEL_ERROR:
            case self::LEVEL_DEBUG:
            case self::LEVEL_TIMING_POINT:
            case self::LEVEL_STRICT:
                break;

            default:
                $verbosityLevel = self::LEVEL_ERROR;
            break;
        }
        if ( $this->MessageOutput & self::OUTPUT_MESSAGE_SCREEN and $enabled )
        {
            print( "$verbosityLevel: $string ($label)\n" );
        }
        $files = $this->logFiles();
        $fileName = false;
        if ( isset( $files[$verbosityLevel] ) )
            $fileName = $files[$verbosityLevel];
        if ( $this->MessageOutput & self::OUTPUT_MESSAGE_STORE or $alwaysLog )
        {
            if ( ! eZDebug::isLogOnlyEnabled() and $enabled )
            {
                $ip = eZSys::clientIP();
                if ( !$ip )
                    $ip = eZSys::serverVariable( 'HOSTNAME', true );
                $this->DebugStrings[] = array( "Level" => $verbosityLevel,
                                               "IP" => $ip,
                                               "Time" => time(),
                                               "Label" => $label,
                                               "String" => $string,
                                               "BackgroundClass" => $backgroundClass );
            }

            if ( $fileName !== false )
            {
                $timePoints = $this->TmpTimePoints[$verbosityLevel];
                if ( is_array( $timePoints ) )
                {
                    if ( $this->isLogFileEnabled( $verbosityLevel ) )
                    {
                        foreach ( $timePoints as $tp )
                        {
                            $desc = "Timing Point: " . $tp["Description"];
                            $this->writeFile( $fileName, $desc, $verbosityLevel, $alwaysLog );
                        }
                    }
                    $this->TmpTimePoints[$verbosityLevel] = false;
                }
                if ( $this->isLogFileEnabled( $verbosityLevel ) )
                {
                    $string = "$label:\n$string";
                    $this->writeFile( $fileName, $string, $verbosityLevel, $alwaysLog );
                }
            }
        }
    }
190777
public function log($line, $severity, $args = self::NO_ARGUMENTS)
	{
        if ($this->_severityThreshold >= $severity) {
            $status = $this->_getTimeLine($severity);
            
            $line = "$status $line";
            
            if ($args !== self::NO_ARGUMENTS) {
                /* Print the passed object value */
                $line = $line . '; ' . var_export($args, true);
            }
            
            $this->writeFreeFormLine($line . PHP_EOL);
			
			if ($this->_mailingSeverity >= $severity) {
				$this->mailLogging($line,$severity);
			}
        }
    }
273683
protected function innerWrite($log, $level = 1, $prefix = null) {
        $level = intval($level);
        if(intval($level) < $this->log_level || $this -> out === null){
            return;
        }
        
        $timestamp = time();
        
        $prefix = $prefix === null ? $this->prefix : $prefix;
        
        $tag = $this->tags[$level];
        
        $msg = "[$tag][$timestamp][$prefix] $log; \n";
        
        if (is_callable($this -> out)) {
            $out = $this -> out;
            $out($msg . '<br />');   // if out to page , add the BR, easy to watch 
            return;
        }
        
        fwrite($this -> out, $msg);
    }
643218
public static function write_log($chain, $type, $file="", $line=""){
        /*if(filesize(PATHAPP . 'logs/log.txt') > 100000){           
            $arch= fopen(PATHAPP . 'logs/log.txt', "w");
            fclose($arch); 
        }*/
        $arch = fopen(PATHAPP . 'logs/log-' . date('Y-m-d') . '.txt', "a+"); 
        if(ENOLA_MODE == 'HTTP'){
            fwrite($arch, "[".date("Y-m-d H:i:s.u")." ".filter_input(INPUT_SERVER, 'REMOTE_ADDR')." "." - $type ] ".$chain." - $file - $line \n");
        }else{
            fwrite($arch, "[".date("Y-m-d H:i:s.u")." MODE CLI "." - $type ] ".$chain." - $file - $line \n");
        }
        fwrite($arch, "---------- \n");
        fclose($arch);
    }
532917
public function msg($msg)
    {
        $this->log .= date('Y-m-d H:i:s') . ' ' . $msg . "\n";

        if (php_sapi_name() === 'cli') {
            $this->cli->line($msg);
        } else {
            echo $msg . "<br/>\n";
        }
    }
728867
public function log($message)
	{
		if($this->logLevel == self::LOG_NORMAL) {
			fwrite(STDOUT, "*** " . $message . "\n");
		}
		else if($this->logLevel == self::LOG_VERBOSE) {
			fwrite(STDOUT, "** [" . strftime('%T %Y-%m-%d') . "] " . $message . "\n");
		}
	}