# Console buffer length

**URL:** <https://discourse.processing.org/t/console-buffer-length/42308>\
**Category:** Beginners\
**Created:** [June 29, 2023, 9:53am UTC](https://discourse.processing.org/t/console-buffer-length/42308 "2023-06-29T09:53:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hareti](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@hareti](https://discourse.processing.org/u/hareti)\
**Post date:** [June 29, 2023, 9:53am UTC](https://discourse.processing.org/t/console-buffer-length/42308/1 "2023-06-29T09:53:05Z")

</div>

Hi, how do you increase the length of the console buffer ? Mine only stores about 500 lines and then they are lost. Can’t see anything in settings.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 29, 2023, 10:17am UTC](https://discourse.processing.org/t/console-buffer-length/42308/2 "2023-06-29T10:17:56Z")

</div>

I’d rather recommend to fill a String array and store it with  
saveStrings or write it in a box on the screen

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [June 29, 2023, 1:56pm UTC](https://discourse.processing.org/t/console-buffer-length/42308/3 "2023-06-29T13:56:26Z")

</div>

An easier way would simply redirect output to a file. This sketch starts with console output but will change to a file if you hit the ‘o’ key and back to console with the ‘c’ key.

```auto
import java.io.*;

PrintStream o, console;

void setup() {
  size(320, 240);
  console = System.out;
  try {
    o = new PrintStream(sketchPath("") + new File("a.txt"));
  }
  catch(Exception e) {
    System.err.println("Unable to create file output stream");
  }
  System.setOut(console);
}

void draw() {
  background(200, 200, 255);
  if (frameCount % 50 == 0)
    println(frameCount);
}

void keyTyped() {
  if (key == 'c')
    System.setOut(console);
  else if (key == 'o')
    System.setOut(o);
}

```

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 16, 2023, 11:43am UTC](https://discourse.processing.org/t/console-buffer-length/42308/4 "2023-08-16T11:43:11Z")

</div>

Adding to the topic…

Another option is to send data out the serial port to a serial terminal of your choice; this can be done with virtual COM ports and a local bridge.

A virtual serial port driver is available here:  
[https://www.hhdsoftware.com/](https://www.hhdsoftware.com/)

Free version:

> **[FREE Virtual Serial Ports driver, Rs-232 null modem emulator](https://freevirtualserialports.com/)**
>
> Freeware virtual com port driver and Rs232/Rs485/Rs422 serial ports null-modem cable emulator

Use any serial terminal of your choice:  
[https://learn.sparkfun.com/tutorials/terminal-basics/real-term-windows](https://learn.sparkfun.com/tutorials/terminal-basics/real-term-windows)  
Above link is NOT a complete list.

Most serial terminals providing logging.

With a virtual serial port you can send data from Processing to the terminal software and use that for logging.

Great for working with serial communication locally as well!

Similar can be done with the networking tools:

> **[Network](https://processing.org/tutorials/network/)**
>
> An introduction to sending and receiving data with clients and servers.

`:)`
