Sets the underlying Writer where exceptions are printed to.

@param writer the Writer to log to
14532
public static void setWriter(final Writer writer) {
        LowLevelLogUtil.writer = new PrintWriter(Objects.requireNonNull(writer), true);
    }
169704
public void save(Writer writer) throws IOException {
        BufferedWriter bufferWriter = new BufferedWriter(writer);
        writePrefixDeclaration(bufferWriter);
        writeMappingDeclaration(bufferWriter);
        bufferWriter.flush();
        bufferWriter.close();
    }
257617
public void setOutput(OutputStream stream, String encoding)
    throws UnsupportedEncodingException {
        
        if (encoding == null) {
            encoding = "UTF8";
        }
        
        java.io.Writer writer = new OutputStreamWriter(stream, encoding);
        fOut = new PrintWriter(writer);
        
    }
562343
public void writeParseText(Writer writer) throws IOException {
        require(prefs.readParse, "AgigaPrefs.readParse must be true for writeParseText()");
        writer.write(parseText);
        writer.write("\n");
    }
432904
public void write(Writer writer, Map<String, String> outputProperties) throws TransformerException {
		Transformer transformer;
		try {
			transformer = TransformerFactory.newInstance().newTransformer();
		} catch (TransformerConfigurationException e) {
			//should never be thrown because we're not doing anything fancy with the configuration
			throw new RuntimeException(e);
		} catch (TransformerFactoryConfigurationError e) {
			//should never be thrown because we're not doing anything fancy with the configuration
			throw new RuntimeException(e);
		}

		/*
		 * Using Transformer#setOutputProperties(Properties) doesn't work for
		 * some reason for setting the number of indentation spaces.
		 */
		for (Map.Entry<String, String> entry : outputProperties.entrySet()) {
			String key = entry.getKey();
			String value = entry.getValue();
			transformer.setOutputProperty(key, value);
		}

		DOMSource source = new DOMSource(document);
		StreamResult result = new StreamResult(writer);
		transformer.transform(source, result);
	}
576428
private void handleWriteException(Throwable ex) {
        if (ex instanceof ObjectClosedException && !this.closed.get()) {
            log.warn("{}: Caught ObjectClosedException but not closed; closing now.", this.traceObjectId, ex);
            close();
        }
    }
879582
@SuppressWarnings("unchecked")
	public void addWriter(RecordWriter<SerializationDelegate<T>> writer)
	{
		// avoid using the array-list here to reduce one level of object indirection
		if (this.writers == null) {
			this.writers = new RecordWriter[] {writer};
		}
		else {
			RecordWriter<SerializationDelegate<T>>[] ws = new RecordWriter[this.writers.length + 1];
			System.arraycopy(this.writers, 0, ws, 0, this.writers.length);
			ws[this.writers.length] = writer;
			this.writers = ws;
		}
	}
125441
public synchronized void setException(Throwable ex) {
    if(_ex == null) {
      _ex = AutoBuffer.javaSerializeWritePojo(((ex instanceof DistributedException) ? (DistributedException) ex : new DistributedException(ex,false /* don't want this setException(ex) call in the stacktrace */)));
    }
  }
883712
public void addWriterListener(WriterListener writerListener) {
        if (writerListener == null) {
            return;
        }
        synchronized (listeners) {
            if (!listeners.contains(writerListener)) {
                listeners.add(writerListener);
            }
        }
    }
84749
public Writer write(Writer writer) throws JSONException {
        try {
            boolean notFirst = false;
            writer.write('{');
            for(Iterator it = myHashMap.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Entry)it.next();
                if (notFirst) {
                    writer.write(',');
                }
                writeQuoted(writer, entry.getKey());
                writer.write(':');
                writeValue(writer, entry.getValue());
                notFirst = true;
            }
            writer.write('}');
            return writer;
        } catch (IOException e) {
            throw new JSONException(e);
        }
    }
1122334
public Writer write(Writer writer) throws JSONException {
        try {
            if (m_map.isEmpty()) {
                writer.write("{}");
                return writer;
            }
            // This prefix value applies to the first key only
            String keyprefix = "{\"";
            for (Entry<String, Object> entry : m_map.entrySet()) {
                writer.write(keyprefix);
                writer.write(quotable(entry.getKey()));
                writer.write("\":");
                Object v = entry.getValue();
                if (v instanceof JSONObject) {
                    ((JSONObject)v).write(writer);
                }
                else if (v instanceof JSONArray) {
                    ((JSONArray)v).write(writer);
                }
                else {
                    writer.write(valueToString(v));
                }
                // This prefix value applies to all subsequent keys
                keyprefix = ",\"";
            }
            writer.write('}');
            return writer;
        }
        catch (IOException exception) {
            throw new JSONException(exception);
        }
     }
1006749
public void handleExceptionWrite(Exception e, List<Object> w)
	  {
	    final String mName = "handleExceptionWrite";
	    
	    if(logger.isLoggable(Level.FINER)) 
	      logger.logp(Level.FINE, className, mName, e.getClass().getName() + "; " + this.toString());

	    if (!isRetryLimitReached() && isRetryable(e))
	    {
	      // Retry it.  Log it.  Call the RetryListener.
	      retryType = RETRY_WRITE;
	      _retryException = e;
	      ++_retryCount;
	      logRetry(e);

	      if (_retryWriteListeners != null) {
	    	  for (RetryWriteListenerProxy retryWriteListenerProxy : _retryWriteListeners) {
	    		  retryWriteListenerProxy.onRetryWriteException(w, e);
				}
	      }
	    }
	    else
	    {
	      // No retry.  Throw it back.
	      if(logger.isLoggable(Level.FINER)) 
	        logger.logp(Level.FINE, className, mName, "No retry.  Rethrow ", e);
	      throw new BatchContainerRuntimeException(e);
	    }
	  }
81350
public void setOriginalException(Throwable originalException) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "setOriginalException");
        _originalException = originalException;
        if (tc.isEntryEnabled())
            Tr.exit(tc, "setOriginalException");
    }
546020
public void writeClose(Writer writer) throws IOException {
		writer.append(CLOSEBRACE).append(CLOSEPARENTHESIS).append(PARENTHESIS).append(SEMICOLON).append(CR); // })();
	}
116438
public static <T> void write(BufferedWriter writer, DatabaseTableConfig<T> config) throws SQLException {
		try {
			writeConfig(writer, config);
		} catch (IOException e) {
			throw SqlExceptionUtil.create("Could not write config to writer", e);
		}
	}
841195
public function setWriter(\Parable\Log\Writer\WriterInterface $writer)
    {
        $this->writer = $writer;
        return $this;
    }
506179
protected void beforePaint(final PrintWriter writer) {
		PageShell pageShell = Factory.newInstance(PageShell.class);

		pageShell.openDoc(writer);
		pageShell.writeHeader(writer);
	}