1. Resources
  2. /
  3. Blog
  4. /
  5. Animated Gifs in Your Log Output

Animated Gifs in Your Log Output

2 minute read

Though we all strive to build software with beautiful visual interfaces we're often stuck with text to diagnose problems during the development process.

Since the first release of Terminal (our open source, screen-emulating log renderer) we've dreamed of adding support for inline images so you could quickly and precisely see what went wrong without you having to dig through your build artifacts and logs.

We're excited to announce that thanks to the amazing contributions to Terminal by Michael Pearson and changes we've made to our log rendering and artifact uploading systems, you can now embed images directly in your build logs! 🎉

Inline images in your build logs

So what can you do with image embedding?

Almost all of the full stack integration testing tools and platforms (such as PhantomJS, Sauce Labs, etc.) support generating screenshots of the test failures as they happen. Instead of linking to screenshots you can embed them directly in your test output, allowing you to debug problems in much less time:

Inline integration test failure images

If you perform front-end performance analysis after every deploy you can use a service like Calibre and embed the resulting loading filmstrip and waterfall graph directly into your build log. Or you could create a responsive design test with Browserstack or CSS regression test with Wraith and show the visual results right there in the log.

Or you could even embed a webcam selfie of your office 🐶!

To start embedding images in your build logs all you need to do is update your build scripts to output the 1338 ANSI escape code as below, and to make sure your build is configured to upload the images as artifacts.

The following bash will embed the dist/screenshot.png artifact image:

1
printf '\033]1338;url=artifact://dist/screenshot.png;alt=Screenshot\a\n'

You can use the following reusable bash function to output the correct codes:

1
2
3
4
5
6
7
function inline_image {
  printf '\033]1338;url='"$1"';alt='"$2"'\a\n'
}

# Usage:
inline_image "artifact://dist/screenshot.png" "Screenshot"
inline_image "http://media.giphy.com/media/3o85xIGA2rB4Tvmsnu/giphy.gif" "Tacos!"

Terminals and tools that don't support this new 1338 escape code will simply show nothing, but if you need to peek at the raw output simply pipe it to the less command.

For more details and how to get started read our new guide: Images in Build Output.

We've also released a capybara-inline-screenshot Ruby gem that automatically embeds Rails application test failures—and it supports embedding images in your iTerm2 window as well.

If you've integrated inline images in a cool way share a screenshot with us in the Buildkite Chat Slack room, and if you need a hand there’s always plenty of friendly build experts to help you out.

We can't wait to see what you build! :shipit:


Related posts

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Pipeline templates
  3. Public pipelines
  4. Test Engine
  5. Package Registries
  6. Mobile Delivery Cloud
  7. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at Scale

Support

  1. System status
  2. Forum