Project

General

Profile

« Previous | Next » 

Revision 3317

input.Makefile: Name logs with extension .log.sql so they are syntax-highlighted for the SQL statements they contain

View differences:

inputs/input.Makefile
91 91

  
92 92
# Must come before `%: %.make` to override it
93 93
src/%: src/%.make _always
94
	(set -x; $(make_script)) 2>>$<.log
94
	(set -x; $(make_script)) 2>>$<.log.sql
95 95
.PRECIOUS: src/% # save partial outputs of aborted src make scripts
96 96

  
97 97
%: %.make _always
......
172 172
	$(if $(isCsv),$(import_install_))
173 173
import_install_ = (prefix=; . $(bin)/vegbien_dest; "time" env schema=$(datasrc)\
174 174
table=$* $(bin)/csv2db $(catSrcs)\
175
$(if $(log),$(if $(quiet),&>,2>&1|tee )import/install-$*.log))
175
$(if $(log),$(if $(quiet),&>,2>&1|tee )import/install-$*.log.sql))
176 176

  
177 177
##### Maps building
178 178

  
......
263 263
profileOnly = -env profile_to=/dev/fd/3 $(map2db) 3>&1 1>&2|\
264 264
$(bin)/profile_stats /dev/fd/0
265 265

  
266
log_ = import/$*$(if $(n),.n=$(n),).$(date).log
267
trace = $(log_:.log=.trace)
266
log_ = import/$*$(if $(n),.n=$(n),).$(date).log.sql
267
trace = $(log_:.log.sql=.trace)
268 268
import = -$(if $(profileTest),$(profileOnly),(set -x; "time" env commit=1\
269 269
$(if $(profile),profile_to=$(trace)) $(map2db)) $(if $(log),\
270 270
$(if $(n),,>>$(log_))) 2>&1$(if $(log),$(if $(n),|tee -a $(log_))))
......
283 283

  
284 284
##### Log files from import
285 285

  
286
logs := $(wildcard import/*.log import/*.trace)
286
logs := $(wildcard import/*.log.sql import/*.trace)
287 287

  
288 288
rm_logs: _always
289 289
	$(RM) $(logs)

Also available in: Unified diff