~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-10 23:12:59 UTC
  • mfrom: (221 trunk)
  • mto: (217.1.9 logging)
  • mto: This revision was merged to the branch mainline in revision 226.
  • Revision ID: guillo.gonzo@gmail.com-20080910231259-4wnfmu30f4n90w6x
 * merge with trunk (resolve conflicts in NEWS and serve-branches)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    parser.add_option("--trunk-dir", metavar="DIR",
45
45
                      help="The directory that contains the trunk branches.")
46
46
    parser.add_option("--port", dest="user_port",
47
 
                      help=("Port Loggerhead should listen on "
48
 
                            "(defaults to 8080)."))
 
47
                      help="Port Loggerhead should listen on (defaults to 8080).")
49
48
    parser.add_option("--host", dest="user_host",
50
49
                      help="Host Loggerhead should listen on.")
51
50
    parser.add_option("--prefix", dest="user_prefix",
52
51
                      help="Specify host prefix.")
53
 
    parser.add_option("--profile", action="store_true", dest="profile",
54
 
                      help="Generate callgrind profile data to "
55
 
                        "%d-stats.callgrind on each request.")
56
52
    parser.add_option("--reload", action="store_true", dest="reload",
57
53
                      help="Restarts the application when changing python"
58
54
                           " files. Only used for development purposes.")
59
 
    parser.add_option('--log-folder', dest="log_folder",
60
 
                      type=str, help="The directory to place log files in.")
 
55
    parser.add_option('--log-folder', dest="log_folder", 
 
56
                      type=str, help="The directory to place log files")
61
57
    parser.add_option("--version", action="store_true", dest="show_version",
62
58
                      help="Print the software version and exit")
63
59
    return parser
86
82
    if options.trunk_dir and not options.user_dirs:
87
83
        print "--trunk-dir is only valid with --user-dirs"
88
84
        sys.exit(1)
89
 
 
 
85
        
90
86
    if options.reload:
91
87
        if Reloader.is_installed():
92
88
            Reloader.install()
100
96
        app = UserBranchesFromFileSystemRoot(path, options.trunk_dir)
101
97
    else:
102
98
        app = BranchesFromFileSystemRoot(path)
103
 
 
 
99
    
104
100
    # setup_logging()
105
101
    logging.basicConfig()
106
102
    logging.getLogger('').setLevel(logging.DEBUG)
119
115
    app = ErrorHandlerApp(app)
120
116
    app = HTTPExceptionHandler(app)
121
117
    app = TransLogger(app, logger=logger)
122
 
    if options.profile:
123
 
        from loggerhead.middleware.profile import LSProfMiddleware
124
 
        app = LSProfMiddleware(app)
125
118
 
126
119
    if not options.user_prefix:
127
120
        prefix = '/'
134
127
        pass
135
128
    else:
136
129
        app = PrefixMiddleware(app, prefix=prefix)
137
 
 
 
130
    
138
131
    if not options.user_port:
139
132
        port = '8080'
140
133
    else: