aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-11-12 12:13:01 +0100
committerBjörn Gustavsson <[email protected]>2014-01-20 12:22:41 +0100
commit67dfe5adf65d95bff5c1ebffbfbf78a4bbf61089 (patch)
treeff0976b9b8b256e1b0b2a4395f51994dde6d4ad8 /lib/asn1/src
parentaf0c7c0274b843551aa5ac393646d6e59ed89fb2 (diff)
downloadotp-67dfe5adf65d95bff5c1ebffbfbf78a4bbf61089.tar.gz
otp-67dfe5adf65d95bff5c1ebffbfbf78a4bbf61089.tar.bz2
otp-67dfe5adf65d95bff5c1ebffbfbf78a4bbf61089.zip
Factor out printing of verbose messages
Diffstat (limited to 'lib/asn1/src')
-rw-r--r--lib/asn1/src/asn1ct.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl
index f2ccf5f212..f2e9606ccb 100644
--- a/lib/asn1/src/asn1ct.erl
+++ b/lib/asn1/src/asn1ct.erl
@@ -333,8 +333,7 @@ print_structured_errors([_|_]=Errors) ->
print_structured_errors(_) -> ok.
compile1(File, #st{opts=Opts}=St0) ->
- verbose("Erlang ASN.1 version ~p, compiling ~p~n", [?vsn,File], Opts),
- verbose("Compiler Options: ~p~n", [Opts], Opts),
+ compiler_verbose(File, Opts),
Passes = single_passes(),
Base = filename:rootname(filename:basename(File)),
OutFile = outfile(Base, "", Opts),
@@ -349,8 +348,7 @@ compile1(File, #st{opts=Opts}=St0) ->
%% compile_set/3 merges and compiles a number of asn1 modules
%% specified in a .set.asn file to one .erl file.
compile_set(SetBase, Files, #st{opts=Opts}=St0) ->
- verbose("Erlang ASN.1 version ~p compiling ~p ~n", [?vsn,Files], Opts),
- verbose("Compiler Options: ~p~n",[Opts], Opts),
+ compiler_verbose(Files, Opts),
OutFile = outfile(SetBase, "", Opts),
DbFile = outfile(SetBase, "asn1db", Opts),
InputModules = [begin
@@ -363,6 +361,11 @@ compile_set(SetBase, Files, #st{opts=Opts}=St0) ->
Passes = set_passes(),
run_passes(Passes, St).
+compiler_verbose(What, Opts) ->
+ verbose("Erlang ASN.1 compiler ~s\n", [?vsn], Opts),
+ verbose("Compiling: ~p\n", [What], Opts),
+ verbose("Options: ~p\n", [Opts], Opts).
+
%% merge_modules/2 -> returns a module record where the typeorval lists are merged,
%% the exports lists are merged, the imports lists are merged when the
%% elements come from other modules than the merge set, the tagdefault