# \[ANN\] Diary.jl 📔

**URL:** <https://discourse.julialang.org/t/ann-diary-jl/45117>\
**Category:** Package Announcements\
**Created:** [August 17, 2020, 3:36pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117 "2020-08-17T15:36:27Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [January 15, 2021, 1:42pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/21 "2021-01-15T13:42:38Z")

</div>

Ideally, set `ENV["JULIA_DEBUG"] = "Diary"` before `using Diary`. Then it should print some information as it loads and which history file it’s tracking. Could you also try to start Julia without Revise and OhMyREPL? Just start a clean session without the startup file: `julia --startup-file=no --project tmp/lel`.

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 15, 2021, 6:50pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/22 "2021-01-15T18:50:10Z")

</div>

> [@Evey](#):
>
> ENV[“JULIA\_DEBUG”] = “Diary”

yeah makes sense to use `"`. Without it threw an error.

```julia
╰─➤ julia --startup-file=no --project=~/tmp/lel [15-01-21 | 7:48:35]
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.5.3 (2020-11-09)
 _/ |\ __'_|_|_|\__'_| |  
|__/ |

julia> x = 1
1

julia> ENV["JULIA_DEBUG"] = "Diary"
"Diary"

julia> using Diary
┌ Debug: Diary.jl: Watching: /tmp/jl_skCPTH
└ @ Diary ~/.julia/packages/Diary/QBchx/src/Diary.jl:36

julia> x = 1
1

julia> x = 2
2

julia> x +m x
ERROR: syntax: extra token "x" after end of expression
Stacktrace:
 [1] top-level scope at none:1
 [2] run_repl(::REPL.AbstractREPL, ::Any) at /build/julia/src/julia-1.5.3/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288

julia> x + x
4

```

Still no file ☹

---

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [January 15, 2021, 6:51pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/23 "2021-01-15T18:51:46Z")

</div>

Can you check if anything is written to the file it is watching? In this case: `/tmp/jl_skCPTH`.

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 15, 2021, 6:59pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/24 "2021-01-15T18:59:00Z")

</div>

The content of the file is:

```julia
36132 # time: 2021-01-15 19:56:25 CET                                                                                                                                                                       
36133 # mode: julia                                                                                                                                                                       
36134 ENV["JULIA_DEBUG"] = "Diary"                                                                                                                                                                       
36135 # time: 2021-01-15 19:56:28 CET 

36136 # mode: julia 

36137 using Diary

```

These were my latest commands

```julia
julia> ENV["JULIA_DEBUG"] = "Diary"
"Diary"

julia> using Diary
┌ Debug: Diary.jl: Watching: /tmp/jl_bC93QO
└ @ Diary ~/.julia/packages/Diary/QBchx/src/Diary.jl:36

julia> x = 1
1

julia> y = 2
2

julia> x + y
3

julia> x = 2
2

```

My history is over 36k entries long, a problem?

---

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [January 15, 2021, 7:02pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/25 "2021-01-15T19:02:30Z")

</div>

It shouldn’t be. Mine is 24k right now.

What surprises me is that it doesn’t write the history log to that file. What is `ENV["JULIA_HISTORY"]` set to?

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 15, 2021, 7:03pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/26 "2021-01-15T19:03:42Z")

</div>

With Diary.jl loaded, it is:

```julia
"JULIA_HISTORY" => "/tmp/jl_bC93QO"

```

---

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [January 15, 2021, 7:05pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/27 "2021-01-15T19:05:27Z")

</div>

And do you have the same issue when you start Julia and load Diary without a startup file? (with `--startup-file=no`)?

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 15, 2021, 7:07pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/28 "2021-01-15T19:07:02Z")

</div>

I tried both, no Dairy.jl file

---

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [January 15, 2021, 7:10pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/29 "2021-01-15T19:10:43Z")

</div>

That is very peculiar. I tried both Julia 1.5.2 and 1.5.3, and I cannot reproduce. What about `REPL.find_hist_file()`?

Also, can you check if what you type in the REPL is written to the standard location: `~/.julia/logs/repl_history` instead?

And what happens if you create a `Diary.toml` file in `~/.julia/config`?

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 15, 2021, 7:13pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/30 "2021-01-15T19:13:12Z")

</div>

```julia
julia> using Diary

julia> using REPL

julia> REPL.find_hist_file()
"/tmp/jl_duDEpW"

```

The standard history file still works flawless. Can I test something else like calling a `save` function or similar?

---

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [January 15, 2021, 7:15pm UTC](https://discourse.julialang.org/t/ann-diary-jl/45117/31 "2021-01-15T19:15:48Z")

</div>

Ok, then it seems like Diary is loading and working correctly, but Julia for some reason does not respect the history file location that it is told to use. I’m a bit surprised as to why that would happen, though I’ve noticed it when loading OhMyREPL.

[Previous page](https://discourse.julialang.org/t/ann-diary-jl/45117.md?page=1)
