@since 0.0.1
@author Igor Ivanovic
@method Logger#write

@description
Write to file and exec hooks
322424
function Logger_write() {
            var log = this.logs.shift();

            if (log && (this.config.type === log.type || this.config.type === 'ALL')) {
                if (this.config.console) {
                    if (log.type === 'ERROR') {
                        exec_console(console.error, log, this.config.streamFormat);
                    } else if (log.type === 'INFO') {
                        exec_console(console.info, log, this.config.streamFormat);
                    } else if (log.type === 'WARNING') {
                        exec_console(console.warn, log, this.config.streamFormat);
                    } else {
                        exec_console(console.log, log, this.config.streamFormat);
                    }
                }

                if (this.stream) {
                    if (this.config.streamFormat === 'json') {
                        this.stream.write(JSON.stringify(log));
                        this.stream.write('\n');
                    } else {
                        this.stream.write('TYPE: ' + log.type);
                        this.stream.write('\n');
                        this.stream.write('CREATED: ' + log.created + '\t ');
                        this.stream.write('\n');
                        this.stream.write('MESSAGE: ' + log.message + '\t ' + log.trace);
                        this.stream.write('\n');
                        this.stream.write('DATA: ' + this.clean(log.data));
                        this.stream.write('\n');
                        this.stream.write('\n');
                    }
                }
                // clean log data for hook
                log.data = this.clean(log.data);
                // call log
                this.hooks.forEach(function (callback) {
                    callback(log);
                });
            }
            /**
             * Exec console output
             * @param func
             * @param log
             */
            function exec_console(func, log, format) {
                if (format === 'json') {
                    func(JSON.stringify(log));
                } else {
                    func(
                        ' ' + log.type + '\n',
                        'CREATED: ' + log.created + '\t ' + '\n',
                        'MESSAGE: ' + log.message + '\t ' + log.trace + '\n',
                        !!log.data ? 'DATA:' + log.data + '\n' : '',
                        '\n'
                    );
                }
            };
        }
1093330
def write(dest)
      path = destination(dest)
      FileUtils.mkdir_p(File.dirname(path))
      Jekyll.logger.debug "Writing:", path
      File.write(path, output, :mode => "wb")
      Jekyll::Hooks.trigger hook_owner, :post_write, self
    end
326788
function writeFile(pathToFile, content, verbose) {
  const directory = path.dirname(pathToFile);

  // Create directory if it doesn't exist
  if (!fs.existsSync(directory)) {
    fs.mkdirSync(directory);
  }

  // Try to write file to disk to the given location
  fs.writeFile(pathToFile, content, { flag: 'w' }, (error) => {
    if (error) {
      throw new Error(error);
    }

    // Log success message to the console if in verbose mode only
    if (verbose) {
      const successMessage = `\nVersion file written to ${chalk.green(pathToFile)}`;

      console.log(successMessage);
    }
  });
}
1066938
function handleStdoutWrite() {
    let stream = process.stderr;
    let str = arguments[0];
    if (typeof str === 'string') {
        if (str.includes('\n')) {
            let result = parseDisplayLength(str, 0, stream.columns);
            readline.clearLine(stream, 1);
            for (let i = 0; i < result.yLength; i++) {
                stream.write('\n');
                readline.clearLine(stream, 0);
            }
            readline.moveCursor(stream, 0, -result.yLength);
        }
        else {
            readline.clearLine(stream, 1);
        }
    }
    stdoutWrite.apply(process.stdout, arguments);
    if (typeof str === 'string')
        readline.clearLine(stream, 1);
}
374952
private String write(String logDir) throws IOException, ExecutionException, InterruptedException {
        final File file = new File(logDir, "trace_" + System.currentTimeMillis() + ".json.gz");
        if (file.exists()) {
            throw new IOException("Trace file " + file.getAbsolutePath() + " already exists");
        }
        if (!file.getParentFile().canWrite() || !file.getParentFile().canExecute()) {
            throw new IOException("Trace file " + file.getAbsolutePath() + " is not writable");
        }

        SettableFuture<Future<?>> f = SettableFuture.create();
        m_work.offer(() -> f.set(dumpEvents(file)));
        final Future<?> writeFuture = f.get();
        if (writeFuture != null) {
            writeFuture.get(); // Wait for the write to finish without blocking new events
            return file.getAbsolutePath();
        } else {
            // A write is already in progress, ignore this request
            return null;
        }
    }
127217
function onWritten(writeErr) {
      var flags = fo.getFlags({
        overwrite: optResolver.resolve('overwrite', file),
        append: optResolver.resolve('append', file),
      });
      if (fo.isFatalOverwriteError(writeErr, flags)) {
        return callback(writeErr);
      }

      callback(null, file);
    }
697696
public synchronized void writeLog(String log) throws IOException {
		if (mFile.length() < mFileMaxSize) {
			writeLogToFile(log, mFile, true);
		} else {
			rotateLogFiles();
			createNewFile();
			writeLogToFile(log, mFile, false);
		}
	}
1134009
function writeLog(level, msg) {
  var line;
  if(showSourceInfo) {
    var si = getSourceInfo();
    if (includeDate) {
      line = util.format("[%s] <%s>\t[%s:%s] %s", moment().format(), level, si.file, si.lineNumber, msg);
    } else {
      line = util.format("<%s>\t[%s:%s] %s", level, si.file, si.lineNumber, msg);
    }
  } else {
    if (includeDate) {
      line = util.format("[%s] <%s>\t%s", moment().format(), level, msg);
    } else {
      line = util.format("<%s>\t%s", level, msg);
    }
  }

  line += '\n';
  appenders.forEach(function(appender) {
    appender(level, line);
  });
}
990736
public function write() {
		Log::instance()->write( 'Writing config.', 1 );

		$create_dir = Utils\create_snapshot_directory();

		if ( ! $create_dir ) {
			Log::instance()->write( 'Cannot create necessary snapshot directory.', 0, 'error' );

			return false;
		}

		file_put_contents( Utils\get_snapshot_directory() . 'config.json', json_encode( $this->config, JSON_PRETTY_PRINT ) );
	}
787372
def writeLogToFile(self):
        
        if not os.path.exists(self.logFolder):
            os.mkdir(self.logFolder)

        with open(self.logFile, mode='a') as f:
            f.write('\n\n' + self.log)
738697
function writeToLog(level, msg)
    {
        var displayPrefix = "PK-" + pkGuid + ": ";
        if(loggingMechanism && logUserObject)
        {
            loggingMechanism.addLog(level, displayPrefix + msg, logUserObject);
        }
        else
        {
            console.log(displayPrefix + msg);
        }
    }
31168
function log(msg) {
  process.stdout.write(time + ' ');
  console.log(colors.log(msg));
}
130532
function writeFile(input, output, type) {
    var json    = readFile(input),
        content = getContent(json, type);

    fs.writeFile(output, content, function (err) {
        if (err) {
            throw err;
        }

        console.log('The file "' + output + '" was written successfully!');
    });
}
716704
function writeExtensionFile(options) {
  return new Promise((resolve, reject) => {
    try {
      const {
        file,
        input,
        defaultContent,
        logNotFound,
        logEnd,
      } = options;
      const filePath = path.resolve(getExtensionsPath(), file);

      if (!input) {
        logger.warn(logNotFound);
        fs.writeFileSync(filePath, defaultContent, { flag: 'w+' });
        return resolve();
      }

      fs.writeFileSync(filePath, input, { flag: 'w+' });
      logger.log(logEnd);

      return resolve();
    } catch (e) {
      return reject(e);
    }
  });
}
590519
private function _writeLog($msg) {
        $log = "-------------------------------------\n";
        $log .= date('Y-m-d H:i:s') . ":\n";
        $log .= $msg."\n";
        $log .= "-------------------------------------\n";
        file_put_contents($this->_output, $log, FILE_APPEND | LOCK_EX);
    }
517387
function (console2, logWriter) {

            //On new log, save it
            console2.on('new', function (log) {

                logWriter.save(log, {
                    logger   : log.opt
                });

            });

            //On new logger, save its options
            console2.on('newLogger', function (logger, loggerOpt) {

                logWriter.addLogger(loggerOpt);

            });
        }
1020524
def write(self, msg):
        
        self._current_stream.write(msg)
        for log in self._logs.values():
            log.append(msg)