1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2
// vim: ts=8 sw=2 smarttab
4
* Ceph - scalable distributed file system
6
* Copyright (C) 2010 Dreamhost
8
* This is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1, as published by the Free Software
11
* Foundation. See file COPYING.
18
* Puts some output into the DoutStreambuf class.
19
* Check your syslog to see what it did.
21
#include "common/DoutStreambuf.h"
22
#include "common/ceph_argparse.h"
23
#include "common/common_init.h"
24
#include "common/config.h"
33
int main(int argc, const char **argv)
35
vector<const char*> args;
36
argv_to_vec(argc, argv, args);
39
common_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
41
DoutStreambuf<char> *dos = new DoutStreambuf<char>();
44
DoutLocker _dout_locker;
45
dos->read_global_config();
47
derr << "using configuration: " << dos->config_to_str() << dendl;
49
std::ostream oss(dos);
50
syslog(LOG_USER | LOG_NOTICE, "TestDoutStreambuf: starting test\n");
53
oss << "1. I am logging to dout now!" << std::endl;
56
oss << "2. And here is another line!" << std::endl;
61
oss << "3. And here is another line!" << std::endl;
75
oss << "5. There will be no blank lines here.\n" << std::endl;
80
syslog(LOG_USER | LOG_NOTICE, "TestDoutStreambuf: ending test\n");