B2G/gecko/services/sync/modules/policies.js
/**
   * Generate a log file for the sync that just completed
   * and refresh the input & output streams.
   *
   * @param flushToFile
   *        the log file to be flushed/reset
   *
   * @param filenamePrefix
   *        a value of either LOG_PREFIX_SUCCESS or LOG_PREFIX_ERROR
   *        to be used as the log filename prefix
   */
Generate a log file for the sync that just completed
and refresh the input & output streams.

@param flushToFile
the log file to be flushed/reset

@param filenamePrefix
a value of either LOG_PREFIX_SUCCESS or LOG_PREFIX_ERROR
to be used as the log filename prefix
Generate a log file for the sync that just completed and refresh the input & output streams . @param flushToFile the log file to be flushed / reset @param filenamePrefix a value of either LOG_PREFIX_SUCCESS or LOG_PREFIX_ERROR to be used as the log filename prefix
function resetFileLog(flushToFile, filenamePrefix) {
    let inStream = this._logAppender.getInputStream();
    this._logAppender.reset();
    if (flushToFile && inStream) {
      try {
        let filename = filenamePrefix + Date.now() + ".txt";
        let file = FileUtils.getFile("ProfD", ["weave", "logs", filename]);
        let outStream = FileUtils.openFileOutputStream(file);
        NetUtil.asyncCopy(inStream, outStream, function () {
          Svc.Obs.notify("weave:service:reset-file-log");
          if (filenamePrefix == LOG_PREFIX_ERROR
              && !ErrorHandler._cleaningUpFileLogs) {
            Utils.nextTick(ErrorHandler.cleanupLogs, ErrorHandler);
          }
        });
      } catch (ex) {
        Svc.Obs.notify("weave:service:reset-file-log");
      }
    } else {
      Svc.Obs.notify("weave:service:reset-file-log");
    }
  }
function resetFileLog ( flushToFile , filenamePrefix ) { let inStream = this . _logAppender . getInputStream ( ) ; this . _logAppender . reset ( ) ; if ( flushToFile && inStream ) { try { let filename = filenamePrefix + Date . now ( ) + ".txt" ; let file = FileUtils . getFile ( "ProfD" , [ "weave" , "logs" , filename ] ) ; let outStream = FileUtils . openFileOutputStream ( file ) ; NetUtil . asyncCopy ( inStream , outStream , function ( ) { Svc . Obs . notify ( "weave:service:reset-file-log" ) ; if ( filenamePrefix == LOG_PREFIX_ERROR && ! ErrorHandler . _cleaningUpFileLogs ) { Utils . nextTick ( ErrorHandler . cleanupLogs , ErrorHandler ) ; } } ) ; } catch ( ex ) { Svc . Obs . notify ( "weave:service:reset-file-log" ) ; } } else { Svc . Obs . notify ( "weave:service:reset-file-log" ) ; } }
Generate a log file for the sync that just completed
 and refresh the input & output streams.
Generate a log file for the sync that just completed and refresh the input & output streams .