# a=string(Pkg.status()) \> "nothing". How to get and save Pkg.status())?

**URL:** <https://discourse.julialang.org/t/a-string-pkg-status-nothing-how-to-get-and-save-pkg-status/24571>\
**Category:** General Usage\
**Created:** [May 24, 2019, 1:46pm UTC](https://discourse.julialang.org/t/a-string-pkg-status-nothing-how-to-get-and-save-pkg-status/24571 "2019-05-24T13:46:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![j\_u](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_u/32/219081_2.png) [@j\_u](https://discourse.julialang.org/u/j_u)\
**Post date:** [July 24, 2022, 12:31pm UTC](https://discourse.julialang.org/t/a-string-pkg-status-nothing-how-to-get-and-save-pkg-status/24571/5 "2022-07-24T12:31:14Z")

</div>

> [@fredrikekre](#):
>
> See [Capture output by 00vareladavid · Pull Request #1053 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/1053)

Hi, I understand this thread is referring to “Basically just add an io field to Context, thread the Context object through a more functions, and make the display stuff use the io field by default.” However, would it be possible to include here the code snippet that is doing this, I mean that is printing the output of `Pkg.status()` to a text file?

My logging to txt file setup currently:

```julia
using Logging
# Open a textfile for writing
io = open("log.txt", "w+")
IOStream("file log.txt")
# Create a simple logger
logger = SimpleLogger(io)
# Set the global logger to logger
global_logger(logger)
# Example of command output printed to log.txt
@info "Sys.CPU_NAME" Sys.CPU_NAME
# Close the file
close(io)

```

I understand that to reproduce the environment its better to use `Project.toml` and `Manifest.toml` files, however, I am doing some benchmarks and my purpose is just to note the version of packages, thus printing the output of `Pkg.status()` would be useful. And when trying `@info Pkg.status()` I am receiving `nothing`, thus this question.

EDIT: I think I got it:

> `Pkg.status(; io)`

---

_[View the full topic](https://discourse.julialang.org/t/a-string-pkg-status-nothing-how-to-get-and-save-pkg-status/24571)._
