Skip to content

Printing & Coloring Output


When writing data to the screen in arc, it is recomended that you use: arc.print(), although it is not required.


arc has a logger setup that will change it's level based on the current enviroment.

import arc

# Uncomment the below line for the log to
# print to the screen.
# arc.configure(enviroment="development")

def command(ctx: Context):
    ctx.logger.debug('hello there!')


The levels are:

  • development: DEBUG
  • production: WARNING


Spice up your script's output with some color! Implements both the basic ANSI-16 color scheme, and rgb


arc.print() has the same signature as print(), while also handling removing escape-codes when not writing to a TTY. Because of this, you should generally always use arc.print() in favor of print()

import arc
from arc import color

def command():
    arc.print(f"{color.fg.RED}This will be in red!{color.effects.CLEAR}")


The reference contains a full breakdown of all the constants and methods


arc.color.colorize() applies an arbitrary number of colors / effects to the provided string, and adds effects.CLEAR to the end of the string.

from arc.color import colorize, fg, bg, effects
arc.print(colorize('This is a colored string', fg.RED, bg.GREY, effects.UNDERLINE))