include/buffer.h\
include/byteorder.h\
include/ceph_fs.h\
+ include/color.h\
include/crc32c.h\
include/cstring.h\
include/encoding.h\
#include "config.h"
#include "tls.h"
+#include "include/color.h"
+
void common_init(std::vector<const char*>& args, const char *module_type, bool daemon)
{
tls_init();
g_daemon = daemon;
if (daemon) {
- cout << " ** WARNING: Ceph is still under heavy development, and is only suitable for **\n";
- cout << " ** testing and review. Do not trust it with important data. **" << std::endl;
+ cout << TEXT_YELLOW << " ** WARNING: Ceph is still under heavy development, and is only suitable for **" << TEXT_NORMAL << std::endl;
+ cout << TEXT_YELLOW << " ** testing and review. Do not trust it with important data. **" << TEXT_NORMAL << std::endl;
g_conf.daemonize = true;
g_conf.log_to_stdout = false;
#include "common/Timer.h"
#include "common/common_init.h"
+#include "include/color.h"
+
void usage()
{
cerr << "usage: cosd -i osdid [--osd-data=path] [--osd-journal=path] [--mkfs]" << std::endl;
int w;
int r = OSD::peek_super(g_conf.osd_data, magic, fsid, w);
if (r < 0) {
- cerr << " ** ERROR: unable to open OSD superblock on " << g_conf.osd_data << ": " << strerror(-r) << std::endl;
+ cerr << TEXT_RED << " ** " << TEXT_HAZARD << "ERROR: " << TEXT_RED
+ << "unable to open OSD superblock on " << g_conf.osd_data << ": " << strerror(-r) << TEXT_NORMAL << std::endl;
if (r == -ENOTSUP)
- cerr << " ** please verify that underlying storage supports xattrs" << std::endl;
+ cerr << TEXT_RED << " ** please verify that underlying storage supports xattrs" << TEXT_NORMAL << std::endl;
derr(0) << "unable to open OSD superblock on " << g_conf.osd_data << ": " << strerror(-r) << dendl;
exit(1);
}
--- /dev/null
+#ifndef __COLOR_H
+#define __COLOR_H
+
+#define TEXT_NORMAL "\033[0m"
+#define TEXT_HAZARD "\033[5;31m"
+#define TEXT_RED "\033[0;31m"
+#define TEXT_GREEN "\033[0;32m"
+#define TEXT_YELLOW "\033[0;33m"
+#define TEXT_BLUE "\033[0;34m"
+#define TEXT_MAGENTA "\033[0;35m"
+#define TEXT_CYAN "\033[0;36m"
+
+#endif