~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to src/mongo/util/ramlog.h

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
    class RamLog : public Tee {
25
25
    public:
26
 
        RamLog( string name );
 
26
        RamLog( const std::string& name );
27
27
 
28
28
        virtual void write(LogLevel ll, const string& str);
29
29
 
31
31
 
32
32
        void toHTML(stringstream& s);
33
33
 
34
 
        static RamLog* get( string name );
 
34
        static RamLog* get( const std::string& name );
35
35
        static void getNames( vector<string>& names );
36
36
 
37
37
        time_t lastWrite() { return _lastWrite; } // 0 if no writes
 
38
        long long getTotalLinesWritten() const { return _totalLinesWritten; }
38
39
 
39
40
    protected:
40
41
        static int repeats(const vector<const char *>& v, int i);
41
42
        static string clean(const vector<const char *>& v, int i, string line="");
42
 
        static string color(string line);
 
43
        static string color(const std::string& line);
43
44
 
44
45
        /* turn http:... into an anchor */
45
46
        static string linkify(const char *s);
48
49
        ~RamLog(); // want this private as we want to leak so we can use them till the very end
49
50
 
50
51
        enum {
51
 
            N = 128, // number of links
52
 
            C = 256 // max size of line
 
52
            N = 1024, // number of lines
 
53
            C = 512 // max size of line
53
54
        };
54
55
        char lines[N][C];
55
56
        unsigned h; // current position
56
 
        unsigned n; // numer of lines stores 0 o N
 
57
        unsigned n; // number of lines stores 0 o N
57
58
        string _name;
 
59
        long long _totalLinesWritten;
58
60
 
59
61
        typedef map<string,RamLog*> RM;
60
62
        static mongo::mutex* _namedLock;