0
votes

I have created a small test application and when on a linux machine I would like to see the messages that appear on the erlang shell to appear on the linux as well. I am not sure how it could be done, but is it possible?

I am running the application in detached mode(erlang shell).

EDIT:

I meant the message passing to the linux shell.

Example: When I start my application using,

test application <start/stop>

I would get a message on the Linux shell Test Application has successfully started

But if I was like copying files, I would like the progress of the file copy to be displayed on the Linux shell like,

Copy successful. Number of files copied : 1
Copy successful. Number of files copied : 2
....

So is it possible to do the above using the message passing from Erlang to Linux?

1
What do you mean by "on the linux as well"? Linux is operating system and not message box. Do you want to print it to file or what? Also what messages do you mean? io:format or just erlang messages sent to the shell process, or smth else?Lol4t0
Some snippets of code would help to understand what you have/what you want to do.aronisstav

1 Answers

0
votes

I believe you can use some logger for this purposes. For example lager can redirect logs to several facilities at the same time, e.g. file and erlang console.

Other option is to use "run_erl", utility which comes with erlang distribution and allows "redirect the standard input and standard output streams so that all output can be logged".

Try erl -man run_erl or you can see can generate "release" with rebar, it will generate startup scripts which use "run_erl".