Skip to content

Commit

Permalink
FIX:: log file to specific path
Browse files Browse the repository at this point in the history
  • Loading branch information
ritarossiDa committed Nov 21, 2022
1 parent 4c257b7 commit f600a27
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,18 @@ If you want you can generate an executable code, see section "Building for sourc

#### Building for source

First you can (recommended to add additional level of security you have to) change the secret key
First you can (recommended to add additional level of security you have to) **change the secret key**

```sh
const j = "jY-1"
```
even if you don't have to change the special key don't worry the software will use the default string and you can use it anyway

Second you **must define the path for the log in main.go line 16**

```const pathLog = "/opt/frm/application/libraries/"
```

For production release move to directory program es: c:\Users\MYNAME\Go and past the code:

```sh
Expand All @@ -113,9 +119,15 @@ The example before is like:
env GOOS=linux GOARCH=amd64 go build -o encdec main.go
```

you can run the executable from a SHELL_EXEC in the same way as reported in the "Easy to use" section
you can run the executable from a SHELL_EXEC in the same way as reported in the "Easy to use" section

you can find all the possible export configurations in the [Table of config contents] section.

Remember: env is a LINUX COMMAND you must use it in LINUX or in GIT BASH

## Errors

you can find all the possible export configurations in the [Table of config contents] section
If you meet errors the key is wrong, remember you can use this software only on a single machine

## Development

Expand Down
4 changes: 2 additions & 2 deletions lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"crypto/rand"
"encoding/hex"
"fmt"
"github.com/denisbrodbeck/machineid"
"io"
"log"
"runtime"

"github.com/denisbrodbeck/machineid"
"runtime"
)

func GenerateKey() string {
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ var (
ErrorLogger *log.Logger
)

const pathLog = "/opt/frm/application/libraries/"

func init() {
file, err := os.OpenFile("./enc_dec.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0777)
file, err := os.OpenFile(pathLog+"enc_dec.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0777)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit f600a27

Please sign in to comment.