Utility for reporting running and loaded OTP applications

Jay Nelson <>
Sat Mar 20 02:01:43 CET 2010

Thought I would share this little function for
reporting the loaded applications.  I find it
helpful when testing or starting up a node
to see whether all the code is included.

-spec report_applications() -> ok.

report_applications() ->
     ColSizes = [15, 10, 35],
     FmtStr =
	  io_lib:format("  ~~-~ws ~~-~ws  ~~-~ws~~n",

     RunningApps = application:which_applications(),
     LoadedApps = application:loaded_applications(),

     report_applications("Running Applications:", FmtStr,
			ColSizes, RunningApps),
     report_applications("Loaded Applications:", FmtStr,
			ColSizes, LoadedApps -- RunningApps).

-spec report_applications(string(), string(),
			  list({atom(), [any()], [any()]})
			 ) -> ok.

report_applications(Title, ColumnFmt, ColSizes, Apps) ->
     io:format("~n~s~n~n", [Title]),
	      ["Application","  Version","  Description"]),
	      [lists:duplicate(Count, $-)
	       || Count <- ColSizes]),
     [io:format(ColumnFmt, [App, Version, Desc])
      || {App, Desc, Version} <- Apps],

It also shows a little format string trickery.
Hopefully the email client wrapping will not
mess up the code.


More information about the erlang-questions mailing list