diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-21 08:47:18 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-21 08:47:18 +0000 |
commit | ce2b2a6f5ca8e2bbdcbe90661bb39bd7d2d16422 (patch) | |
tree | c688f9721443d62109de1d955e514dbe7f5a1d3a /sca-cpp/trunk/components/filedb/filedb.hpp | |
parent | 57ff384203570508e81cdf5dfaa0cb96478e7654 (diff) |
Change default log level from 'info' to 'notice' and improve some of the log messages.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1204402 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/components/filedb/filedb.hpp')
-rw-r--r-- | sca-cpp/trunk/components/filedb/filedb.hpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sca-cpp/trunk/components/filedb/filedb.hpp b/sca-cpp/trunk/components/filedb/filedb.hpp index 993003ce8e..ea7638320f 100644 --- a/sca-cpp/trunk/components/filedb/filedb.hpp +++ b/sca-cpp/trunk/components/filedb/filedb.hpp @@ -175,8 +175,11 @@ const failable<bool> post(const value& key, const value& val, FileDB& db) { const string fn = filename(key, db.name); debug(fn, "filedb::post::filename"); ofstream os(fn); - if (os.fail()) - return mkfailure<bool>("Couldn't post file database entry."); + if (os.fail()) { + ostringstream os; + os << "Couldn't post file database entry: " << key; + return mkfailure<bool>(str(os)); + } const failable<bool> r = write(val, os, db.format); debug(r, "filedb::post::result"); @@ -196,8 +199,11 @@ const failable<bool> put(const value& key, const value& val, FileDB& db) { const string fn = filename(key, db.name); debug(fn, "filedb::put::filename"); ofstream os(fn); - if (os.fail()) - return mkfailure<bool>("Couldn't put file database entry."); + if (os.fail()) { + ostringstream os; + os << "Couldn't put file database entry: " << key; + return mkfailure<bool>(str(os)); + } const failable<bool> r = write(val, os, db.format); debug(r, "filedb::put::result"); @@ -214,8 +220,11 @@ const failable<value> get(const value& key, FileDB& db) { const string fn = filename(key, db.name); debug(fn, "filedb::get::filename"); ifstream is(fn); - if (is.fail()) - return mkfailure<value>("Couldn't get file database entry."); + if (is.fail()) { + ostringstream os; + os << "Couldn't get file database entry: " << key; + return mkfailure<value>(str(os)); + } const failable<value> val = read(is, db.format); debug(val, "filedb::get::result"); @@ -232,8 +241,11 @@ const failable<bool> del(const value& key, FileDB& db) { const string fn = filename(key, db.name); debug(fn, "filedb::del::filename"); const int rc = unlink(c_str(fn)); - if (rc == -1) - return mkfailure<bool>("Couldn't delete file database entry."); + if (rc == -1) { + ostringstream os; + os << "Couldn't delete file database entry: " << key; + return mkfailure<bool>(str(os)); + } debug(true, "filedb::delete::result"); return true; |