~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging.cc

  • Committer: Tim Penhey
  • Date: 2010-01-20 02:39:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1275.
  • Revision ID: tim.penhey@canonical.com-20100120023901-8teeunid6gwlthzx
Add in a rot 13 function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
  }
97
97
};
98
98
 
99
 
class PostEndIterate : public unary_function<plugin::Logging *, bool>
100
 
{
101
 
  Session *session;
102
 
public:
103
 
  PostEndIterate(Session *session_arg) :
104
 
    unary_function<plugin::Logging *, bool>(),
105
 
    session(session_arg) {}
106
 
 
107
 
  /* This gets called once for each loaded logging plugin */
108
 
  inline result_type operator()(argument_type handler)
109
 
  {
110
 
    if (handler->postEnd(session))
111
 
    {
112
 
      /* TRANSLATORS: The leading word "logging" is the name
113
 
         of the plugin api, and so should not be translated. */
114
 
      errmsg_printf(ERRMSG_LVL_ERROR,
115
 
                    _("logging '%s' postEnd() failed"),
116
 
                    handler->getName().c_str());
117
 
      return true;
118
 
    }
119
 
    return false;
120
 
  }
121
 
};
122
99
 
123
100
/* This is the Logging::preDo entry point.
124
101
   This gets called by the rest of the Drizzle server code */
150
127
  return iter != all_loggers.end();
151
128
}
152
129
 
153
 
/* This gets called in the session destructor */
154
 
bool plugin::Logging::postEndDo(Session *session)
155
 
{
156
 
  /* Use find_if instead of foreach so that we can collect return codes */
157
 
  vector<plugin::Logging *>::iterator iter=
158
 
    find_if(all_loggers.begin(), all_loggers.end(),
159
 
            PostEndIterate(session));
160
 
  /* If iter is == end() here, that means that all of the plugins returned
161
 
   * false, which in this case means they all succeeded. Since we want to
162
 
   * return false on success, we return the value of the two being !=
163
 
   */
164
 
  return iter != all_loggers.end();
165
 
}
166
 
 
167
130
} /* namespace drizzled */