Fork me on GitHub
#boot
<
2016-10-06
>
lwhorton18:10:15

am I doing this the wrong way? i have a task that takes a bunch of css files and converts them to cljs files via a command-line executable via dosh. in order for the shell executable to work, I have to write the files into the fileset before transforming them. afterwords, I’m only interested in the executable’s output, and don’t want to clutter the target output with all the “intermediary” files.

lwhorton18:10:47

right now I’m doing a bunch of fs queries by-name/by-path/by-re to remove all the intermediaries, but is there a better way?

lwhorton18:10:15

i.e. not add them to the fs output in the first place? or somehow query the fs for “only things I’ve added, minus all these things I dont care about”?

lwhorton18:10:56

… or on second thought, is this unavoidable? what I’m really doing is adding +output to specific files, and when the target task runs, it’s just moving those output files into a single main.out dir.

lwhorton18:10:11

so the real solution is to either not mark those files as +output, or only do further operations (after boot is finished) on main.out, ignoring everything else

micha18:10:25

@lwhorton are you saying you have one task that creates intermediate files and then another subsequent task that completes processing them, and then after the second task run you no longer want those intermediate files hanging around in the fileset?

lwhorton18:10:00

but I believe that I misunderstood the fileset’s purpose more generally - the target task just gathers everything under one roof, but those dirs/files that were created during a task hang around

lwhorton18:10:53

so if I had a task that created

/build/foo.js
/build/bar.js
/build/baz/a.js
the target task would do something like
/build/main.out/foo.js
/build/main.out/bar.js
/build/main.out/baz/a.js
but the root directory would look like
/build/foo.js
/build/bar.js
/build/baz/a.js
/build/main.out

flyboarder20:10:47

@lwhorton you are looking for the sift task

flyboarder20:10:07

you can use that to filter things from the fileset

flyboarder20:10:24

(sift :to-asset #{#”usefulbut/doesnotwant.js"})

flyboarder20:10:52

asset files are not put in output from target dir

richiardiandrea20:10:19

Wanted to ask an opinion on how to approach error reporting in prod. The log4j2 appender doesnt pretty print and here we don't want to use hosted log services for now. I really would like to avoid rolling my own appender and clojure.logging does not help.

richiardiandrea20:10:50

I know I am finishing off topic, sorry, but this channel is awesome 😄

donaldball21:10:03

I’ve been using unilog recently

richiardiandrea21:10:20

I'll check it out, my problem is that I attach a lot of data to ex-info but then the resulting email/print is very dense and difficult to read

micha21:10:09

@richiardiandrea i send logs to stdout which is piped to syslog

micha21:10:18

usually as json

micha21:10:33

so i can parse it easily with different tools

richiardiandrea21:10:27

What if I log an entire ring request? Are you then able to read it or you employ some parsing afterwards?

micha21:10:50

it depends how large the log message is i guess

micha21:10:15

you probably don't want to log huge things in syslog

richiardiandrea21:10:55

I have already some logic for converting ex-info to understandable Clojure objects..for instance to unroll the stacktrace

richiardiandrea21:10:15

But log4j does not know about that

richiardiandrea21:10:43

And I am afraid I will need some custom stuff ..or just like you log as json

micha21:10:06

i do print stack traces as they are

micha21:10:23

(log/error ex "Something bad happen")

micha21:10:45

since it's a human who is going to be consuming the stack trace

micha21:10:59

what i log as json is stuff that i may want to feed back into the computer later

micha21:10:21

like if i have a queue service i might log out the queue message or something

micha21:10:43

like if something goes wrong i may need to feed it back into some process to fix the glitch

richiardiandrea21:10:54

Yes for that i do the same, in what we call "bad-events"

richiardiandrea21:10:46

But then we receive an emril, which is ugly :)

micha21:10:26

we use a combination of logs and metrics

micha21:10:40

metrics are to detect a problem

micha21:10:49

the log is to provide context when investigating

micha21:10:00

so you may have a metric of "bad events"

micha21:10:11

and if you get more than x per 10 minutes or whatever you get an alert

richiardiandrea21:10:39

Yes, that alert

micha21:10:43

otherwise you can just check the metric every so often as you do your rounds

richiardiandrea21:10:49

We have so much stuff in it that they always compare it to some Rails report :)

richiardiandrea21:10:26

And I need to find a way to dispel that and make it pretty ah ah

richiardiandrea21:10:29

Ruby spoiled the good ol' scroll-in-the-terminal style :)

richiardiandrea21:10:28

Thanks Micha for your inputs

micha21:10:28

i do very much enjoy just logging to stdout

micha21:10:14

if only i could devise a foolproof way to silence logging from dependencies and 3rd party code that i use in my applications

micha21:10:16

then i would be set

richiardiandrea21:10:12

@micha doesn't the standard way of doing it with log4j work for you?

richiardiandrea21:10:37

I create a logger with the package and raise the level to error here

richiardiandrea21:10:47

And the dep logging is gone

richiardiandrea21:10:19

Since I have all the set of bindings that log4j2 provides, everything is caught

micha21:10:46

like the AWS SDK for instance logs stuff that i don't want

richiardiandrea21:10:46

Ok never tried that one explicitly but I can try it out...at the moment I mute all the hikari db pool stuff, undertow...things that I don't need

richiardiandrea21:10:58

I'll report back

micha21:10:11

can you paste a snippet of how you create the logger etc when you get a chance?

richiardiandrea21:10:06

yep sure I have it here

richiardiandrea21:10:03

the above is for prod

richiardiandrea21:10:03

Found a project were i do use aws

micha21:10:16

i wish i didn't need to get involved with xml files and stuff, or dependencies

micha21:10:43

i almost figured out how to do it with no deps and no xml, but something is missing somewhere

micha21:10:38

mind the 🥥

naomarik22:10:42

if you could obliterate xml from our lives i would love you

richiardiandrea22:10:29

Lol ahah, there must be a way via code..why "" to .getLogger ? Probably it is not rpplying the level from the root of the packages hieraschy somehow

micha22:10:04

yeah i don't fully understand how it is supposed to work, there is dependency injection going on

richiardiandrea22:10:05

Yes that's true, i just don't know which logger is taken by using "" i would take just .getRootLogger

micha22:10:27

ah ok, that might be the problem

flyboarder22:10:55

Does anyone know how to adjust the boot-cljs task to make a nodejs entrypoint? I’m trying to follow this: https://github.com/clojure/clojurescript/wiki/Quick-Start#running-clojurescript-on-nodejs

flyboarder22:10:18

Ah I think i might be getting it