Full example: xwalk_utils.cc or similar.

#include <iostream>

class Console {
private:
  Console() {};
  friend Console& console();
};

Console& console() {
  static Console c;
  return c;
}

typedef std::ostream& (*Manipulator) (std::ostream&);

template <class T> Console& operator<<(Console& console, const T& s) {
  std::cout << s; // NOLINT
  return console;
}

Console& operator<<(Console& console, Manipulator manipulator) {
  std::cout << manipulator; // NOLINT
  return console;
}

int main () {
   console() << "hest no. " << 323 << std::endl;
}