Show More
@@ -73,7 +73,7 b' c.Global.log_level = 20' | |||||
73 |
|
73 | |||
74 | # c.InteractiveShell.logfile = 'ipython_log.py' |
|
74 | # c.InteractiveShell.logfile = 'ipython_log.py' | |
75 |
|
75 | |||
76 |
# c.InteractiveShell.log |
|
76 | # c.InteractiveShell.logappend = 'mylog.py' | |
77 |
|
77 | |||
78 | # c.InteractiveShell.object_info_string_level = 0 |
|
78 | # c.InteractiveShell.object_info_string_level = 0 | |
79 |
|
79 |
@@ -166,13 +166,13 b' cl_args = (' | |||||
166 | ), |
|
166 | ), | |
167 | (('-logfile','-lf'), dict( |
|
167 | (('-logfile','-lf'), dict( | |
168 | type=str, dest='InteractiveShell.logfile', default=NoConfigDefault, |
|
168 | type=str, dest='InteractiveShell.logfile', default=NoConfigDefault, | |
169 |
help="S |
|
169 | help="Start logging to logfile.", | |
170 | metavar='InteractiveShell.logfile') |
|
170 | metavar='InteractiveShell.logfile') | |
171 | ), |
|
171 | ), | |
172 |
(('-log |
|
172 | (('-logappend','-la'), dict( | |
173 |
type=str, dest='InteractiveShell.log |
|
173 | type=str, dest='InteractiveShell.logappend', default=NoConfigDefault, | |
174 |
help=" |
|
174 | help="Start logging to logappend in append mode.", | |
175 |
metavar='InteractiveShell.log |
|
175 | metavar='InteractiveShell.logfile') | |
176 | ), |
|
176 | ), | |
177 | (('-pdb',), dict( |
|
177 | (('-pdb',), dict( | |
178 | action='store_true', dest='InteractiveShell.pdb', default=NoConfigDefault, |
|
178 | action='store_true', dest='InteractiveShell.pdb', default=NoConfigDefault, |
@@ -209,7 +209,7 b' class InteractiveShell(Component, Magic):' | |||||
209 | ipythondir= Unicode('', config=True) # Set to get_ipython_dir() in __init__ |
|
209 | ipythondir= Unicode('', config=True) # Set to get_ipython_dir() in __init__ | |
210 | logstart = CBool(False, config=True) |
|
210 | logstart = CBool(False, config=True) | |
211 | logfile = Str('', config=True) |
|
211 | logfile = Str('', config=True) | |
212 |
log |
|
212 | logappend = Str('', config=True) | |
213 | object_info_string_level = Enum((0,1,2), default_value=0, |
|
213 | object_info_string_level = Enum((0,1,2), default_value=0, | |
214 | config=True) |
|
214 | config=True) | |
215 | pager = Str('less', config=True) |
|
215 | pager = Str('less', config=True) | |
@@ -466,20 +466,10 b' class InteractiveShell(Component, Magic):' | |||||
466 | self.logger = Logger(self, logfname='ipython_log.py', logmode='rotate') |
|
466 | self.logger = Logger(self, logfname='ipython_log.py', logmode='rotate') | |
467 | # local shortcut, this is used a LOT |
|
467 | # local shortcut, this is used a LOT | |
468 | self.log = self.logger.log |
|
468 | self.log = self.logger.log | |
469 | # template for logfile headers. It gets resolved at runtime by the |
|
|||
470 | # logstart method. |
|
|||
471 | self.loghead_tpl = \ |
|
|||
472 | """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE *** |
|
|||
473 | #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW |
|
|||
474 | #log# opts = %s |
|
|||
475 | #log# args = %s |
|
|||
476 | #log# It is safe to make manual edits below here. |
|
|||
477 | #log#----------------------------------------------------------------------- |
|
|||
478 | """ |
|
|||
479 |
|
469 | |||
480 | def init_logstart(self): |
|
470 | def init_logstart(self): | |
481 |
if self.log |
|
471 | if self.logappend: | |
482 |
self.magic_logstart(self.log |
|
472 | self.magic_logstart(self.logappend + ' append') | |
483 | elif self.logfile: |
|
473 | elif self.logfile: | |
484 | self.magic_logstart(self.logfile) |
|
474 | self.magic_logstart(self.logfile) | |
485 | elif self.logstart: |
|
475 | elif self.logstart: |
@@ -1154,10 +1154,8 b' Currently the magic system has the following functions:\\n"""' | |||||
1154 | if logfname: |
|
1154 | if logfname: | |
1155 | logfname = os.path.expanduser(logfname) |
|
1155 | logfname = os.path.expanduser(logfname) | |
1156 | self.shell.logfile = logfname |
|
1156 | self.shell.logfile = logfname | |
1157 | # TODO: we need to re-think how logs with args/opts are replayed |
|
1157 | ||
1158 | # and tracked. |
|
1158 | loghead = '# IPython log file\n\n' | |
1159 | # loghead = self.shell.loghead_tpl % (rc.opts,rc.args) |
|
|||
1160 | loghead = self.shell.loghead_tpl % ('','') |
|
|||
1161 | try: |
|
1159 | try: | |
1162 | started = logger.logstart(logfname,loghead,logmode, |
|
1160 | started = logger.logstart(logfname,loghead,logmode, | |
1163 | log_output,timestamp,log_raw_input) |
|
1161 | log_output,timestamp,log_raw_input) |
General Comments 0
You need to be logged in to leave comments.
Login now